Forced End Of For To Next Instruction Loop - Mitsubishi Electric MELSEC-Q/L Programming Manual

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Forced end of FOR to NEXT instruction loop

BREAK(P)
High
Basic
Process
performance
(D): 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.
Setting
Internal device
data
Bit
(D)
Pn
Processing details
• 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.
Forced end condition
When forced end condition is satisfied
Pn
• The remaining number of the FOR to NEXT instruction loop times is stored at (D). Note that the remaining number includes
the operation when the BREAK instruction is executed.
• The BREAK instruction can be used only during the execution of a FOR to NEXT instruction loop.
• 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
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
Error details
code
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.
7 APPLICATION INSTRUCTIONS
460
7.6 Structure Creation Instructions
Redundant Universal
LCPU
BREAK
BREAKP
R, ZR
Word
* *
FOR
K
BREAK
D
Pn
NEXT
Command
BREAK
Command
BREAKP
J\
U\G
Bit
Word
If the BREAK instruction is not executed,
program returns to the FOR instruction
as many times as the number specified
with the FOR instruction.
Q00J/
Q00/
Q01
D
Pn
D
Pn
Zn
Constant
QnH
QnPH
QnPRH
Others
P
QnU
LCPU

Advertisement

Table of Contents
loading

Table of Contents