Program control (output instruction)
JMP: Jump
Skips forward to the matching LBL, so the rungs in between do not execute this scan.
Also called: JMP, skip rungs, conditional jump.
JMP(label)What it does
JMP and LBL let a scan skip a block of rungs. Where a JSR organises code, a JMP suppresses it, and that difference matters more than it looks.
Skipped rungs are not evaluated at all. A plain OTE inside a skipped block holds whatever value it had, because nothing set it to 0 either. That is very often not what people expect, and it is why MCR exists as a separate instruction: an MCR zone drives its non-retentive outputs false, while a jump simply leaves them alone.
Jumps make a program harder to read and much harder to troubleshoot online, because the rung you are watching may not be running. Prefer a JSR, or a permissive contact, unless a jump is genuinely the clearest thing.
A rung you can run
Skip the diagnostic block unless diagnostics are enabled
XIO(Diag_Enable)JMP(SkipDiag)
XIC(Sensor_A)OTE(Diag_Lamp_A)
XIC(Sensor_B)OTE(Diag_Lamp_B)
LBL(SkipDiag)
XIC(Run_Cmd)OTE(Machine_Run)With diagnostics off the two lamp rungs are skipped, and the lamps hold their last state rather than turning off. If they must go dark, drive them false explicitly or use an MCR zone.
Run this rung in the simulatorWhat it is called on other controllers
| Platform | Equivalent |
|---|---|
| Rockwell (Studio 5000) | JMP |
| Siemens (TIA Portal) | JMP |
| Mitsubishi (GX Works) | CJ |
Common mistakes
- Expecting outputs in a skipped section to turn off. They freeze instead.
- Jumping backwards and creating a loop that does not finish inside one scan.
- Using jumps where a routine would read better, which is most of the time.
