I seen straight things happen putting jmp before any other command on the same rung. I thought everything was read and processed before the jmp happens? It has to do with the scanning?
"JMP" is a logical term, not an actual GOTO. So the actual instruction scan continues whether the JMP was executed or not.
All JMP really does is 2 things:
1. Disable the SG you are in (so a JMP S5 within SG S2 will turn OFF the S2 stage bit immediately), but the logic within S2 will continue for that current PLC scan
2. Enable the SG you are jumping to (so S5 will be set ON)
That's all JMPs do. JMP does NOT affect the scanning within the current stage at all.
SGSET just SETs the bit for the S# in the SGSET. SGRST just RESETs the bit for the S# in the SGRST. Likewise, these do NOT affect the instruction scanning.
And, the magic of Stage, is that on the scan AFTER an ENABLED stage is DISABLED, TERMINATION LOGIC gets executed one time for all the instructions in the newly disabled Stage. This is what makes OUT coils turn OFF, and other instructions "reset".
Note that the EXIT instruction DOES IMMEDIATELY EXIT by changing the instruction pointer to the end of the code-block. So EXIT WILL "jump" logic.