NCT Group 99M Microscope & Magnifier User Manual


 
20 Custom Macro
165
particular number. For example,
In the above example, variable #8 has already been assigned a value by the second address J
(value, -12), since the value of address E is also assigned to variable #8, the control returns error
message 3064 BAD MACRO STATEMENT.
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
Macro body
%O1250
G0 Z#18
(rapid-traverse positioning in direction Z to the
point specified at address R–1)
G1 Z#26 F#9
(drilling as far as the point Z specified at
address Z–100, with the feed specified at address
F130)
G4 P#24
(dwell at the bottom of the hole for the time
specified at address X2)
G65 A2.12 B3.213 J36.9 J–12 E129.73 P2200
variable
#1=2.12
#2=3.213
#5=36.9
#8=–12
#8= ERROR
...
G66 P1250 Z–100 R–1 X2 F130 (Z=Z point of hole, R=R point of hole,
X=dwell F=feed)
G91 G0 X100
Y30 drilling is performed after each posi-
tioning
X150
...
G67