Originally Posted by
avirostick
Hi I am trying to create a g code program with variables. I am very new to this and wanted to try to create a custom drill program. I'm sure it is wrong but wanted to post it here so people could see and help me fix it. I didn't include a G65 macro call but just variable assignments and an attempt at a loop. I'm trying to drill .5 deep at a certain speed/feed, remain in hole (dwell), then continue drilling hole hole at another speed/feed. I want to be able to do this to multiple holes like a canned cycle. Here's my attempted code...**The G91 X1 is to move 1 inch to next hole location**
%
O0001(HOLE DRILL LOOP)
#1=-.5
#2=-1.0
#3=1000
#4=2000
#5=.25
G20
G0 G17 G40 G49 G80 G90
T1 M6
G0 G90 G54 X0. Y0. S1000 M3
G43 H01 S#3 M8
G1 Z#1 F3 G04 P.05
G1 Z#2 S#4 F4
G1 Z#5 F30
G91 X1
G90
WHILE[Z EQ.25]DO1
G1 Z#1 F3 P1.5
G1 Z#2 S#4 F4
G1 Z#5 F30
G91 X1
G90
END1