Fanuc Series 15i/150i-MA (Programming) Operators Manual

17.CUSTOM MACRO PROGRAMMING B-63324EN/03
- 626 -
- Nesting
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 PS0124
occurs.
Limitation
- Infinite loops
When DO m is specified without specifying the WHILE statement, an
infinite loop ranging from DO to END is produced.
- Processing time
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.
Processing
1.The identification numbers (1
to 3) can be used as many
times as required.
WHILE [- - -] DO 1 ;
END 1 ;
:
Processing
WHILE [- - -] DO 1 ;
END 1 ;
:
2.DO ranges cannot
overlap.
Processing
WHILE [- - -] DO 1 ;
END 1 ;
Processing
WHILE [- - -] DO 2 ;
:
END 2 ;
3.DO loops can be nested to a
maximum depth of three levels.
WHILE [- - -] DO 1 ;
:
WHILE [- - -] DO 2 ;
:
WHILE [- - -] DO 3 ;
Processing
END 3 ;
:
END 2 ;
:
END 1 ;
4.Control can be transferred to
the outside of a loop.
WHILE [- - -] DO 1 ;
END 1 ;
IF [- - -] GOTO n ;
Nn
5.Branches cannot be made to a
location within a loop.
WHILE [- - -] DO 1 ;
:
END 1 ;
IF [- - -] GOTO n ;
:
Nn c ;

Leave a Reply

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