
PROGRAMMING
13. CUSTOM MACRO
B–63664EN/02
258
G65 P9100 X x Y y Z z F f I i A a B b H h ;
X: X coordinate of the center of the circle
(absolute or incremental specification)(#24)
Y: Y coordinate of the center of the circle
(absolute or incremental specification)(#25)
Z : Hole radius (#26)
F : Cutting feedrate (#9)
I : Radius of the circle (#4)
A: Drilling start angle(#1)
B: Incremental angle (clockwise when a negative value is specified)
(#2)
H: Number of holes (#11)
O0002;
G90 G92 X0 Y0 Z0;
G65 P9100 X100.0 Y50.0 Z–10.0 F500 I100.0 A0 B45.0 H5;
M30;
O9100;
#3=#4003; Stores G code of group 3.. . . . . . . . . .
IF[#3 EQ 90]GOTO 1; Branches to N1 in the G90 mode..
#24=#5001+#24; Calculates the X coordinate of the center.. . . . . .
#25=#5002+#25; Calculates the Y coordinate of the center.. . . . . .
N1 WHILE[#11 GT 0]DO 1;
Until the number of remaining holes . . . . . . . . . . . . . . . . . .
reaches 0
#5=#24+#4*COS[#1]; Calculates the X coordinate of the hole center.. .
#6=#25+#4*SIN[#1]; Calculates the Y coordinate of the hole center.. .
#5=#5+#26; X coordinate of the drilling start position. . . . . . . . .
G90 G00 X#5 Y#6; Moves to the drilling start position.. . . .
G02 I–#26 F#9; Drilling. . . . . .
#1=#1+#2; Updates the angle.. . . . . . . . . .
#11=#11–1; Decrements the number of holes.. . . . . . . . . .
END 1;
G#3; Returns the G code to the original state.. . . . . . . . . . . . . . .
M99;
Meaning of variables:
#3: Stores the G code of group 3.
#5: X coordinate of the drilling start position for the hole to be drilled
#6: Y coordinate of the drilling start position for the hole to be drilled
D Calling format
D Program calling a macro
program
D Macro program
(called program)