6F3B0253

7. Instructions

FUN 133

NEXT

NEXT (FOR-NEXT loop)

Expression

Input [ NEXT ]Output

Function

This instruction configures a FOR-NEXT loop.

If the input is OFF, The repetition is forcibly broken. and the program execution is moved to the next instruction.

Execution condition

Input

Operation

Output

OFF

Forcibly breaks the repetition

OFF

ON

Repetition

ON

Operand

No operand is required.

Example

When R005 is ON, the program segment between FOR and NEXT is executed 30 times in a scan. In the above example, the rung 3 is executed 30 times. As a result, the data of D0000 to D0029 are transferred to D0500 to D0529. (Block transfer)

Note

The FOR instruction must be used with a corresponding NEXT instruction one by one.

Nesting of the FOR-NEXT loop is not allowed. That is, the FOR instruction cannot be used in a FOR-NEXT loop.

The FOR and NEXT instructions cannot be programmed on the same rung.

The following connection is not allowed.

[ FOR n ]

[ NEXT ]

206 T1-16S User’s Manual

Page 208
Image 208
Toshiba 6F3B0253 user manual Next FOR-NEXT loop