Applied Instructions
First execute the instructions between FOR~NEXT instructions for several times
(the loop time is assigned by the source data), then execute the steps after NEXT.
FOR K6
INC D0
NEXT
FOR K7
INC D1
NEXT
NEXT
FOR K5
M0
M3
M1
[A]
[B]
[C]
S·
z FOR、NEXT instructions must be programmed as a pair. Nesting is allowed, and the
nesting level is 8.
z Between FOR/NEXT, LDP、LDF instructions are effective for one time. Every time when
M0 turns from OFF to ON, and M1 turns from OFF to ON, [A] loop is executed 6 times.
z Every time if M0 turns from OFF to ON and M3 is ON, [B] loop is executed 5×7=35
times.
z If there are many loop times, the scan cycle will be prolonged. Monitor timer error may
occur, please note this.
z If NEXT is before FOR, or no NEXT, or NEXT is behind FENG,END, or FOR and
NEXT number is not equal, an error will occur.
z Between FOR~NEXT, CJ nesting is not allowed, also in one STL, FOR~NEXT must be
programmed as a pair.
[FOR] AND [NEXT]
16 bits instruction:FOR、NEXT 32 bits instruction:-
Suitable Models:
XC1、XC3、XC5
Suitable Device
Word
D
FD
DM
DX
DY
DS
TD
CD
K/H
Device
Bit
Device
X
Y
M
S
T
C
Dn.m
D·
D·
Function
75