Program execution control instructions
1013
Part III FP Instructions
LOOP
Loop to label
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
The LBL instructions are specified as destination of the LOOP instruction. It is not possible to
specify two or more LBL instructions with the same number Num* within a program. If the set
value s in the data area is "0" from the beginning, the LOOP instruction is not executed (ignored).
It is not possible to use this function in a function block POU.
The maximum possible value that can be assigned to Num* depends
on the PLC type.
PLC types
Availability of LOOP (see page 1328)
Variable Data type Function
s INT, WORD Set value
Num* constant Constant number that must correspond to LBL number, this
"nested" program is looped until the variable at s reaches 0
For Relay T/C Register Constant
s WX WY WR WL SV EV DT LD FL -
Description
LOOP (Loop to Label) instruction skips to the LBL (see page 1013) instruction with the same
number Num* as the LOOP instruction and repeats execution of what follows until the data of a
specified operand becomes "0".
Data types
Operands
Example
In this example the function is programmed in ladder diagram (LD).