6F3B0250
7. Instructions
FUN 132
FOR
FOR (FOR-NEXT loop)
Expression
Input
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 |
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | 1 - 32767 |
|
|
| times |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
Basic Hardware and Function 223
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net