EasyManua.ls Logo

Mitsubishi Electric MELSEC-Q/L - Forced End of for to NEXT Instruction Loop

Mitsubishi Electric MELSEC-Q/L
1084 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
460
7 APPLICATION INSTRUCTIONS
7.6 Structure Creation Instructions
Forced end of FOR to NEXT instruction loop
BREAK(P)
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.
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.
(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
data
Internal device R, ZR J\ U\G Zn Constant Others
P
Bit Word Bit Word
(D) 
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
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.

Table of Contents

Related product manuals