beautypg.com

Instructions fun 132 for for (for-next loop) – Toshiba 6F3B0253 User Manual

Page 207

background image

6F3B0253

Basic Hardware and Function

205

7. Instructions

FUN 132

FOR

FOR (FOR-NEXT loop)

Expression

Input

[ FOR n ]

Output

Function

When the input is ON, the program segment between FOR and NEXT is executed n times
repeatedly in a scan.
When the input is OFF, the repetition is not performed. (the segment is executed once)

Execution condition

Input

Operation

Output

OFF

No repetition

OFF

ON

Repetition

ON

Operand

Name

Device

Register

Constant Index

X

Y

R

S

T.

C. XW YW RW SW T

C

D

I

J

K

n Repetition

times

1 - 32767

Example

This segment is executed 30 times repeatedly in a scan.

When R005 is ON, the program segment between FOR and NEXT is executed 30 times in a
scan.

R005

| | [ FOR 30 ]

[ NEXT ]

Executed 30 times in a scan when
R005 is ON.