PROGRAMMING15. CUSTOM MACRO
B–64124EN/01
334
The same operation as the drilling canned cycle G81 is created using a
custom macro and the machining program makes a modal macro call. For
program simplicity, all drilling data is specified using absolute values.
Z=0
R
Z
The canned cycle consists of the following
basic operations:
Operation 1:
Positioning along the X–axis and Y–axis
Operation 2:
Rapid traverse to point R
Operation 3:
Cutting feed to point Z
Operation 4:
Rapid traverse to point R or I
Rapid traverse
Cutting feed
Operation 1
Position I
Operation 2
Operation 4
Position R
Operation 3
Position Z
G65 P9110 X x Y y Z z R r F f L l ;
X: X coordinate of the hole (absolute specification only) (#24). . . .
Y: Y coordinate of the hole (absolute specification only) (#25). . . .
Z : Coordinates of position Z (absolute specification only) (#26). . .
R: Coordinates of position R (absolute specification only) (#18). . .
F : Cutting feedrate (#9). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
L : Repetition count
O0001;
G28 G91 X0 Y0 Z0;
G92 X0 Y0 Z50.0;
G00 G90 X100.0 Y50.0;
G66 P9110 Z–20.0 R5.0 F500;
G90 X20.0 Y20.0;
X50.0;
Y50.0;
X70.0 Y80.0;
G67;
M30;
O9110;
#1=#4001; Stores G00/G01.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#3=#4003; Stores G90/G91.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
#4=#4109; Stores the cutting feedrate.. . . . . . . . . . . . . . . . . . . . . . . .
#5=#5003; Stores the Z coordinate at the start of drilling.. . . . . . . . . .
G00 G90 Z#18; Positioning at position R. . . . . . . . . . . . . . . . . . . . .
G01 Z#26 F#9; Cutting feed to position Z. . . . . . . . . . . . . . . . . . . . . .
IF[#4010 EQ 98]GOTO 1; Return to position I. . . . . . . . . . . . . . . . . .
G00 Z#18; Positioning at position R. . . . . . . . . . . . . . . . . . . . . . . . .
GOTO 2;
N1 G00 Z#5; Positioning at position I. . . . . . . . . . . . . . . . . . . . . . . . . . .
N2 G#1 G#3 F#4; Restores modal information.. . . . . . . . . . . . . . . . .
M99;
Sample program
D Calling format
D Program that calls a
macro program
D Macro program
(program called)