342
7 APPLICATION INSTRUCTION
7.4 Structuring instruction
Forcibly terminating the FOR to NEXT instruction loop
BREAK(P)
This instruction forcibly terminates the FOR to NEXT instruction loop and shifts the program execution to the pointer specified
by (P).
■Descriptions, ranges, and data types
■Applicable devices
• This instruction forcibly terminates the FOR to NEXT instruction loop and shifts the program execution to the pointer
specified by (P). Only the pointer numbers within the same program file can be specified in (P). If a pointer in another
program is specified in (P), an operation error occurs.
• In (d), the number of remaining FOR to NEXT instruction loops at the forced termination is stored. Note that the number
includes the loop when the BREAK(P) instructions are executed.
• The BREAK(P) instructions can be used only between the FOR and NEXT instructions.
• The BREAK(P) instructions can be used for only one nesting level. To forcibly terminate multiple nesting levels, execute as
many BREAK(P) instructions as the number of nesting levels.
• If the branch pointer number of the BREAK instruction outside two nesting levels or more is specified, an operation error
occurs and the program execution stops when the BREAK instruction is executed.
Ladder diagram Structured text
Not supported
Operand Description Range Data type Data type (label)
(d) Device number storing the number of remaining loops 16-bit signed binary ANY16
(P) Pointer number of the branch destination when the loop is
forcibly terminated
Device name ANY16
Operand Bit Word Double word Indirect
specification
Constant Others
X, Y, M, L,
SM, F, B, SB
U\G T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U\G Z LC LZ K, H E $
(d)
(P)
When the BREAK instruction is
not executed, the program
execution returns to the FOR
instruction as many times as
specified by the FOR
instruction.
BREAK
NEXT
(d) (P)
FOR K**
(P)
When the forced termination
condition is satisfied
Forced
termination
condition