
B-63942EN/02 NC FUNCTION 5.PROGRAM INPUT
- 213 -
• Macro call using M code
Custom macros can be called by pre-determined M codes which
are set by parameters.
The following command
N_ G65 Pxxxx <Argument assignment> ;
is equivalent to the following command:
N_ Myy <Argument assignment> ;
The correspondence between M codes (Myy) and program
number (Pxxxx) of a macro shall be set by a parameter.
M codes are not sent out the same as the sub program call using
M code.
• Sub program call using M code
An M code can be set by parameter to call a sub program.
Instead of commanding:
N_ G_ X_ Y_ . . . M98 Pxxxx ; ,
the same operation can be performed simply by commanding:
N_ G_ X_ Y_ . . . Myy ;.
As for M98, M codes are not transmitted.
The M code (Myy) for calling the sub program and the sub
program number (Pxxxx) to be called are coupled together and
set by parameter.
• Sub program call using T code
By setting parameter, sub program can be called by T codes.
When commanded:
N_ G_ X_ Y_ . . . Tt ;
the same operation is done as when commanded:
#149=t ;
N_ G_ X_ Y_ . . . M98 P9000 ;
The T code t is stored as arguments of common variable #149.
• Sub program call using S code
By setting parameter, sub program can be called by S codes.
When commanded:
N_ G_ X_ Y_ . . . Ss ;
the same operation is done as when commanded:
#147=s ;
N_ G_ X_ Y_ . . . M98 P9029 ;
The S code s is stored as arguments of common variable #147.
• Sub program call using second auxiliary function code
By setting parameter, sub program can be called by second
auxiliary function codes (B). When commanded:
N_ G_ X_ Y_ . . . Bb ;
the same operation is done as when commanded:
#146=b ;
N_ G_ X_ Y_ . . . M98 P9028 ;
The B code b is stored as arguments of common variable #146.