16. CUSTOM MACRO
Once G66 is issued to specify a modal call a macro is called after a block
specifying movement along axes is executed. This continues until G67
is issued to cancel a modal call.
G66 P9100 L2 A1.0 B2.0 ;
G00 G90 X100.0 ;
G00 Z–#1 ;
G01 Z–#2 F0.3 ;
G66 P p L ȏ <argument–specification> ;
P : Number of the program to call
ȏ : Repetition count (1 by default)
Argument : Data passed to the macro
D After G66, specify at address P a program number subject to a modal
D When a number of repetitions is required, a number from 1 to 9999 can
be specified at address L.
D As with a simple call (G65), data passed to a macro program is
specified in arguments.
When a G67 code is specified, modal macro calls are no longer performed
in subsequent blocks.
Calls can be nested to a depth of four levels including simple calls (G65)
and modal calls (G66). This does not include subprogram calls (M98).
Modal calls can be nested by specifying another G66 code during a modal
D In a G66 block, no macros can be called.
D G66 needs to be specified before any arguments.
D No macros can be called in a block which contains a code such as a
miscellaneous function that does not involve movement along an axis.
D Local variables (arguments) can only be set in G66 blocks. Note that
local variables are not set each time a modal call is performed.
Modal Call (G66)
D Call nesting
D Modal call nesting