Fanuc Power Mate i-D/H Operator Manual

PROGRAMMING
(Common to Power Mate i–D and –H)
B–63174EN/03
13. CUSTOM MACRO
123
Specify a conditional expression after WHILE. While the specified
condition is satisfied, the program from DO to END is executed. If the
specified condition is not satisfied, program execution proceeds to the
block after END.
WHILE [conditional expression] DO m ; (m=1,2,3)
END m ;
:
Processing
If the condition
is not satisfied
If the condition
is satisfied
While the specified condition is satisfied, the program from DO to END
after WHILE is executed. If the specified condition is not satisfied,
program execution proceeds to the block after END. The same format as
for the IF statement applies. A number after DO and a number after END
are identification numbers for specifying the range of execution. The
numbers 1, 2, and 3 can be used. When a number other than 1, 2, and 3
is used, alarm No.126 occurs.
The identification numbers (1 to 3) in a DO–END loop can be used as
many times as desired. Note, however, when a program includes crossing
repetition loops (overlapped DO ranges), alarm No.124 occurs.
1. The identification numbers
(1 to 3) can be used as many
times as required.
WHILE [ ] DO 1 ;
END 1 ;
:
WHILE [ ] DO 1 ;
END 1 ;
WHILE [ ] DO 1 ;
END 1 ;
:
WHILE [ ] DO 2 ;
END 2 ;
WHILE [ ] DO 1 ;
WHILE [ ] DO 2 ;
:
WHILE [ ] DO 3 ;
:
END 3 ;
:
END 2 ;
:
END 1 ;
WHILE [ ] DO 1 ;
END 1 ;
IF [ ] GOTO n ;
Nn
WHILE [ ] DO 1 ;
END 1 ;
IF [ ] GOTO n ;
Nn ;
:
2. DO ranges cannot overlap.
Processing
Processing
Processing
Processing
Processing
3. DO loops can be nested to a
maximum depth of three levels.
4. Control can be transferred to
the outside of a loop.
5. Branches cannot be made to
a location within a loop.
13.5.3
Repetition
(WHILE Statement)
Explanations
Nesting

Leave a Reply

Your email address will not be published. Required fields are marked *