Download Instructions & Programming

Transcript
Chapter 2. Functions
2.7.4
FOR – NEXT
(Applicable for K200S / K300S / K1000S)
FOR and NEXT instructions should be in pairs, and each pairs should be start by FOR
instructions. The maximum nesting level of FOR-NEXT block is 5.
If there is a stand-alone FOR or NEXT instruction or the nesting level exceeds 6, a program
error occurs and CPU stops operation.
LOAD
P000
FOR
1
FOR
2
FOR
3
: No error (3 level nesting)
NEXT
NEXT
NEXT
END
LOAD
FOR
P001
20
NEXT
NEXT
: Error (Stand-alone NEXT)
END
LOAD
FOR
END
P002
20
:Error (No END instruction is permitted
between FOR and NEXT)
NEXT
END
2-33