For To Next; 38 For To Next - Omron SCARA YRCX Series Programming Manual

Robot controller
Hide thumbs Also See for SCARA YRCX Series:
Table of Contents

Advertisement

38

FOR to NEXT

8
8
Performs loop processing until the variable exceeds the specified value
A
A
B
B
C
C
D
D
E
E
F
F
G
G
H
H
I
I
J
J
K
K
L
L
M
M
8-64
8-64
Chapter 8 Robot Language Lists
Chapter 8 Robot Language Lists
Format
FOR control variable = start value TO end value STEP step
command block
NEXT control variable
Explanation
These statements repeatedly execute commands between the FOR to NEXT
statements for the <start value> to <end value> number of times, while changing the
<control variable> value in steps specified by <STEP>.
If <STEP> is omitted, its value becomes "1".
The <STEP> value may be either positive or negative.
The <control variable> must be a numeric <simple variable> or <array variable>.
The FOR and NEXT statements are always used as a set.
SAMPLE
'CYCLE WITH CYCLE NUMBER OUTPUT TO DISPLAY
FOR A=1 TO 10
MOVE P,P0
MOVE P,P1
MOVE P,P2
PRINT"CYCLE NUMBER=";A
NEXT A
HALT
Related commands
EXIT FOR

Advertisement

Table of Contents
loading

Table of Contents