16. CUSTOM MACRO
- Macro call by G codes
The macro can also be called by the parameter–set G codes. Instead
N_ G65 Pffff <argument assignment> ;
macro can be called just by commanding:
N_ G** <argument assignment> ;.
G code for calling the macro, and macro program number **** to be
called, are coupled together and set as parameter.
Maximum ten G codes from G01 to G9999 can be used for macro call
(G00 cannot be used).
The G code macro call cannot be used in the macro which was called
by a G code. It also cannot be used in sub programs called by sub
program call with M codes or T codes.
- Macro call by M code
Custom macros can be called by pre–determined M codes which are
set by parameters.
The following command
N_ G65 Pffff <Argument assignment> ;
is equivalent to the following command:
N_ Mxx <Argument assignment> ;
The correspondence between M codes (Mxx) and program number
(delta delta delta delta) of a macro shall be set by a parameter.
Signal MF and M code are not sent out the same as the subprogram call
by M code.
Also when this M code is specified in a program called a macro calling
G code or a subprogram calling M or T code, the M code is regarded
as a normal M code.
Up to ten M codes from M01 to M99999999 can be used for custom
macro calling M codes.
- Sub program call by M code
An M code can be set by parameter to call a sub program. Instead of
N_ G_ X_ Y_ … M98 Pffff ; ,
the same operation can be performed simply by commanding:
N_ G_ X_ Y_ … MXX ;.
As for M98, M codes are not transmitted.
The M code XX for calling the sub program and the sub program
number delta delta delta delta to be called are coupled together and set
Maximum ten M codes from M01 to M99999999 can be used for
Arguments cannot be transmitted. It also cannot be commanded in the
same block as the block with M98 command.
When these M codes are commanded in macro called by G code or in
subprogram called by M code or T code, they are regarded as ordinary