
PROGRAMMING
B–63614EN/01
15. CUSTOM MACRO
313
G65 P9100 X x Y y Z z R r 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 depth (#26). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R: Coordinates of an approach point (#18). . . . . . . . . . . . . . . . . . . . .
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 Z100.0;
G65 P9100 X100.0 Y50.0 R30.0 Z–50.0 F500 I100.0 A0 B45.0 H5;
M30;
O9100;
#3=#4003; Stores G code of group 3.. . . . . . . . . . . . . . . . . . . . . . . . .
G81 Z#26 R#18 F#9 K0; (Note) Drilling cycle.. . . . . . . . . . . . . . . . . .
Note: L0 can also be used.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
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 a drilling position on the X–axis.. . . .
#6=#25+#4*SIN[#1]; Calculates a drilling position on the Y–axis.. . . .
G90 X#5 Y#6; Performs drilling after moving to the target position..
#1=#1+#2; Updates the angle.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#11=#11–1; Decrements the number of holes.. . . . . . . . . . . . . . . . . . .
END 1;
G#3 G80; 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 next hole to drill
#6: Y coordinate of the next hole to drill
D Calling format
D Program calling a macro
program
D Macro program
(called program)