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

PROGRAMMING
13. PROGRAM CONFIGURATION
B–62754EN/01
140
NOTE
1 The M98 and M99 signals are not output to the machine
tool.
2 If the subprogram number specified by address P cannot be
found, an alarm (No. 078) is output.
l M98 P51002 ;
l X1000.0 M98 P1200 ;
l Execution sequence of subprograms called from a main program
A subprogram can call another subprogram in the same way as a main
program calls a subprogram.
This command specifies “Call the subprogram (number 1002) five times
in succession.” A subprogram call command (M98P_) can be specified
in the same block as a move command.
This example calls the subprogram (number 1200) after an X movement.
1
2
3
Main program
N0010 ;
N0020 ;
N0030 M98 P21010 ;
N0040 ;
N0050 M98 P1010 ;
N0060 ;
Subprogram
O1010 ;
N1020 ;
N1030 ;
N1040 ;
N1050 ;
N1060 M99 ;
If P is used to specify a sequence number when a subprogram is
terminated, control does not return to the block after the calling block, but
returns to the block with the sequence number specified by P. Note,
however, that P is ignored if the main program is operating in a mode other
than memory operation mode.
This method consumes a much longer time than the normal return method
to return to the main program.
Subprogram
O0010 ;
N1020 ;
N1030 ;
N1040 ;
N1050 ;
N1060 M99 P0060 ;
Main program
N0010 ;
N0020 ;
N0030 M98 P1010 ;
N0040 ;
N0050 ;
N0060 ;
Examples
Special Usage
D Specifying the sequence
number for the return
destination in the main
program

Leave a Reply

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