Fanuc Series 15i/150i-MA (Programming) Operators Manual

17.CUSTOM MACRO PROGRAMMING B-63324EN/03
- 634 -
- Program calling a macro program
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;
- Macro program (called program)
O9100;
#3=#4003; ......................Stores G code of group 3.
G81 Z#26 R#18 F#9 L0; .....Drilling cycle.
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

Leave a Reply

Your email address will not be published. Required fields are marked *