Jumps JMP JMPC JMPNC JMPCN
Remarks
A jump to a label branches the execution of the program after the specified label.
See how to add a jump to a label here.
In ST"Structured text" A high-level language that is block structured and syntactically resembles Pascal language, labels and jumps cannot be used.
In FBD"Function block diagram" A function block diagram describes a function between input variables and output variables. A function is described as a set of elementary blocks 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 FFLD language, the "-->>" 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.
In IL"Instruction list" This is a low-level language and resembles assembly language, JMP, JMPC, JMPCN and JMPNC instructions are used to specify a jump. The destination label is the operand of the jump instruction.
-
-
Backward jumps can lead to infinite loops that block the target cycle.
ST Language
Not available
FBD Language
(* In this example the TON block will not be called if bEnable is TRUE *)
FFLD Language
Each rung can begin with a label.
Labels are used as destination for jump instructions.
In this example the network #6 is skipped if IN1 is TRUE.
IL Language
Below is 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:
See also