93
4-3-4 [FOR] and [NEXT]
1)Summary
Loop execute the program between FOR and NEXT with the specified times;
Normally ON/OFF,
Rising/Falling edge
2)Operands
Program’s loop times between FOR and NEXT
3)Suitable Soft Components
*Notes: D includes D, HD; TD includes TD, HTD; CD includes CD, HCD, HSCD, HSD; DM
includes DM, DHM; DS includes DS, DHS. M includes M,HM,SM;S includes S,HS;T
includes T,HT;C includes C, HC.
FOR.NEXT instructions must be programmed as a pair. Nesting is allowed, and the nesting
level is 8.
The program after NEXT will not be executed unless the program between FOR and NEXT is
executed for specified times.
Between FOR and 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 5×6=30
times.
Every time if M0 turns from OFF to ON and M3 is ON, [B] loop is executed 5×7=35 times.
If there are many loop times, the scan cycle will be prolonged. Monitor timer error may occur,
please note this.
If NEXT is before FOR, or no NEXT, or NEXT is behind FEND,END, or FOR and NEXT
number is not equal, an error will occur.
tudonghoatoancau.com