7.6 Structured Instructions
7.6.1 FOR to NEXT instruction loop
7-101
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
FOR, NEX
T
FOR, NEXT
(4) Up to 16 nesting levels are applicable for the FOR instruction.
O
peration Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The FEND or GOEND instruction was executed before the execution of the NEXT
instruction and after the execution of the FOR instruction.
(Error code: 4200)
• The NEXT instruction is executed prior to the execution of the FOR instruction.
(Error code: 4201)
• The STOP instruction has been inserted between the FOR and NEXT instructions.
(Error code: 4200)
• The 17th FOR instruction is executed when FOR instructions have been nested.
(Error code: 4202)
FOR i
nstruct
i
ons
can
b
e
neste
d
up
to
16 d
eep
.
X
0
X
2
X
1
FOR
EN ENO
n
5
FOR
EN ENO
n
3
FOR
EN ENO
n
100
NE
X
T
EN ENO
NE
X
T
EN ENO
NE
X
T
EN ENO
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......