![](/images/new-backgrounds/1256769/256769329x1.webp)
20 Custom Macro
particular number. For example,
G65 A2.12 B3.213 J36.9
variable #1=2.12 #2=3.213 #5=36.9
In the above example, variable #8 has already been assigned a value by the second address J (value,
A decimal point and a sign can also be transferred at the addresses.
20.2 The Modal Macro Call
20.2.1 Macro Modal Call in Every Motion Command (G66)
As a result of instruction
G66 P(program number) L(number of repetitions) <argument assignment>
the macro body specified at address P (program number) will be called after the execution of each motion command, as many times as is the number specified at address L. The interpretations of addresses P and L and the rules of argument assignment are identical with those described for instruction G65.
The selected macro will be called until with command
G67
it is canceled.
For example, a hole has to be drilled in a given segment of the part program after each movement:
Main program
...
G66 P1250
G91 G0 X100
Y30
X150
...
G67
Macro body
%O1250 G0 Z#18
G1 Z#26 F#9
G4 P#24
drilling is performed after each posi- tioning
(drilling as far as the point Z specified at address
(dwell at the bottom of the hole for the time specified at address X2)
165