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

12.PROGRAM CONFIGURATION PROGRAMMING B-63324EN/03
- 270 -
12.2 SUBPROGRAM (M98, M99)
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.
Format
- Subprogram configuration
One subprogram
Subprogram number (or the colon (:)
optionally in the case of ISO)
Program end
M99 need not constitute a separate block as indicated
below.
Example)X100.0Y100.0M99;
- Subprogram call
M98 Pxxxxxxxx Lxxxxxxxx ;
Subprogram number Number of times the subprogram
is called repeatedly
When no repetition data is specified, the subprogram is
called just once.
Explanation
When the main program calls a subprogram, it is regarded as a one-
level subprogram call. Thus, subprogram calls can be nested up to ten
levels as shown below.
O1000;
.
.
.
M98 P2000;
.
.
.
M30;
O5677;
.
.
.
M98 P5678;
.
.
.
M99;
O3000;
.
.
.
M98 P4000;
.
.
.
M99;
O2000;
.
.
.
M98 P3000;
.
.
.
M99;
O5678;
.
.
.
.
.
.
.
M99;
(One-level nesting) (Two-level nesting) (Nine-level nesting) (Ten-level nesting)
Main program Subprogram Subprogram Subprogram Subprogram
O1234;
:
:
M99;

Leave a Reply

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