385
BREAK, BREAKP
1
2
3
4
4
6
7
8
7.6 Structure creation instructions
7.6.2 BREAK, BREAKP
: Number of the device where the remaining number of loops will be stored (BIN 16 bits)
Pn : Number of the pointer (device name (pointer)) where the program is branched at the forced end of a loop.
Function
(1) Forces an end to a FOR to NEXT instruction loop and shifts the operation to the pointer specified by Pn. Only a pointer
within the same program file can be assigned to Pn. If a pointer of the other program file is used, an operation error will
be returned.
(2) The remaining number of the FOR to NEXT instruction loop times is stored at .
Note that the remaining number includes the operation when the BREAK instruction is executed.
(3) The BREAK instruction can be used only during the execution of a FOR to NEXT instruction loop.
(4) The BREAK instruction can be used only when there is only one level of nesting. When an end is forced to the multiple
nesting levels, execute the same number of BREAK instructions for the nesting levels.
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
7.6.2 BREAK, BREAKP F orced end of FOR to NEXT instruction loop
7.6.2
BREAK, BREAKP
Setting
Data
Internal Devices
R, ZR
J\
U\G
Zn Constants
Other
P
Bit Word Bit Word
–– ––
Pn –– ––
Error
code
Error details
Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4203
The BREAK instruction is used in a case other than with the FOR to
NEXT instruction loop.
4210
The jump destination for the pointer specified by Pn does not exist.
The pointer of another program file is specified for Pn.
Basic
Process
High
performance
Redundant
Universal
LCPU
Pn
Pn
BREAK
BREAKP
D
D
Command
Command
BREAKP
BREAK
D
D
Pn
Pn
Forced end condition
*
*
BREAK
KFOR
NEXT
When forced end condition is satisfied
D
If the BREAK instruction is not executed,
program returns to the FOR instruction
as many times as the number specified
with the FOR instruction.
D