/
FOR-NEXT Repetition
FOR-NEXT Repetition
FOR-NEXT Repetition: FOR, NEXT
Instruction | Device address | No. of Steps | Flag | |||||||||||||||
M | X | Y | K | L | F | T | C | S | Z | D | @D | Int. | Error | Zero | Carry | |||
FOR | S | o | o | o | o | o | o | o | o | - | o | o | o | o | 2 | o | - | - |
NEXT | S | - | - | - | - | - | - | - | - | - | - | - | - | - | 1 |
n | Repeat Count for FOR and NEXT (1 ~ 32767). |
Error (F110) | Occurs when a device is assigned to @D and the device range limit exceeds. |
Functions
Repeats the instructions between the FOR and the NEXT for the designated number of times.
The repeat count (n) can be assigned to one of the numbers from 1 to 32767.
When the repeat count (n) number is from -32767 to 0, this instruction is operated as n=1.
The nesting for the FOR instruction is possible up to 16 times.
Example)
When M01 is turned OFF, the FOR-NEXT instruction is executed.
When M01 is turned ON, the FOR-NEXT instruction is NOT executed.
, multiple selections available,
Related content
Forcefully End FOR-NEXT Repetition
Forcefully End FOR-NEXT Repetition
More like this
Repetitive Statement
Repetitive Statement
More like this
FOR-NEXT 명령 : FOR, NEXT
FOR-NEXT 명령 : FOR, NEXT
More like this
Call the Sub Routine Program
Call the Sub Routine Program
More like this
MUL (BINARY)
MUL (BINARY)
More like this
Set or Reset Master Control
Set or Reset Master Control
More like this