Hello and welcome to JustAnswer!
Do you mean that the P0351 is setting because you are unplugging the coil, or does the P0351 set on it's own while you are driving?
it is flagging after car dies,reconnect scanner,and this is the code
Ok great. That's what I figured but wanted to double check.
P0351 sets when there is a problem in the circuit from the ASD relay through the coil and back to the engine controller (PCM). This code can set because of an open wire between the PCM and coil, from the coil to the ASD relay, it could be the coil, or the PCM itself. If the problem is intermittent it's most likely not the coil.
What I would do if I was looking at it is check the primary resistance of the coil. If ok, then I would move on to load testing the ASD wire and driver wire to the coil while wiggle testing. If no problems are found then I would condemn the PCM. The PCM itself is the most probable cause for this code and these symptoms on a 4.0 Jeep.