FANUC Series 16/18/160/180-Model C for Lathe Operator Manual

PROGRAMMING
B–62754EN/01
13. PROGRAM CONFIGURATION
139
If a program contains a fixed sequence or frequently repeated pattern, such
a sequence or pattern can be stored as a subprogram in memory to simplify
the program.
A subprogram can be called from the main program.
A called subprogram can also call another subprogram.
O jjjj ;
M99 ;
Subprogram number
(or the colon (:) optionally in the case of ISO)
Program end
One subprogram
M99 need not constitute a separate block as indicated below.
Example)
X100.0 Y100.0 M99 ;
M98 P ffff ffff ;
Subprogram
number
Number of times
the subprogram is
called repeatedly
When no repetition data is specified, the subprogram is called just once.
When the main program calls a subprogram, it is regarded as a one–level
subprogram call. Thus, subprogram calls can be nested up to four levels
as shown below.
O0001
;
M98P100
0 ;
M30 ;
Main program
O3000
;
M99 ;
O1000
;
M98P200
0 ;
M99 ;
O2000
;
M98P300
0 ;
M99 ;
Subprogram
(One–level nesting) (Two–level nesting) (Three–level nesting)
Subprogram Subprogram
O4000
;
M99 ;
(Four–level nesting)
Subprogram
M98P400
0 ;
A single call command can repeatedly call a subprogram up to 9999 times.
For compatibility with automatic programming systems, in the first
block, Nxxxx can be used instead of a subprogram number that follows
O (or :). A sequence number after N is registered as a subprogram number.
See Chapter 10 in Part III for the method of registering a subprogram.
13.3
SUBPROGRAM
Format
D Subprogram
configuration
D Subprogram call (M98)
Explanations
Reference item

Leave a Reply

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