Jumps JMP JMPC JMPNC JMPCN
Remarks
A jump to a label branches the execution of the program after the specified label.
See Insert Jump for directions on how to add a jump to a label.
-
-
Backward jumps can lead to infinite loops that block the target cycle.
FBD Language Example
- In the FBD Language, a jump is
represented by a signpost containing the label name.
- The input of the signpost must be connected to a valid Boolean signal.
- The jump is performed only if the input is TRUE.
In this example, the TON block is not called if bEnable is TRUE.
FFLD Language Example
- In the FFLD Language, the Insert Jump symbol (), followed by the target label name, is used as a coil at the end of a rung.
- The jump is performed only if the rung state is TRUE.
- Each rung can begin with a label.
- Labels are used as a destination for jump instructions.
In this example, Network #6 is skipped if IN1 is TRUE.
IL Language Example
- In the IL language, JMP, JMPC, JMPCN and JMPNC
instructions are used to specify a jump.
- The destination label is the operand of the jump instruction.
- These are the meaning of possible jump instructions:
- JMP Jump always.
- JMPC Jump if the current result is TRUE.
- JMPNC Jump if the current result is FALSE.
- JMPCN Same as JMPNC.
(* My comment. *) Start: FFLD IN1
JMPC TheRest (* Jump to "TheRest" if IN1 is TRUE *)
FFLD IN2 (* these three instructions are not executed *)
ST Q2 (* if IN1 is TRUE *)
JMP TheEnd (* unconditional jump to "TheEnd" *)
TheRest: FFLD IN3
ST Q3
TheEnd:
ST Language Example
Not available.
See Also