FANUC Series 16/18/160/180-Model C Machining Center Operators Manual

PROGRAMMING
16. CUSTOM MACRO
B–62764EN/01
390
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), P/S 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 lev-
els.
4. Control can be transferred to
the outside of a loop.
5. Branches cannot be made to
a location within a loop.
When DO m is specified without specifying the WHILE statement, an
infinite loop ranging from DO to END is produced.
When a branch to the sequence number specified in a GOTO statement
occurs, the sequence number is searched for. For this reason, processing
in the reverse direction takes a longer time than processing in the forward
direction. Using the WHILE statement for repetition reduces processing
time.
In a conditional expression that uses EQ or NE, a <vacant> and zero have
different effects. In other types of conditional expressions, a <vacant> is
regarded as zero.
D Nesting

D Infinite loops
D Processing time
D Undefined variable

Leave a Reply

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