1
General Mach Discussion / Subroutine Using M98
« on: August 18, 2009, 07:52:14 PM »
This is the first program I've ever written in G code, and surprise, surprise it doesn't work! I'm trying to create a subroutine to change my Z position by three thousands of an inch increments. I know there are a lot of threads on here that already discuss this topic, but I haven't been able to find a solution that makes this code work. This is what I have:
G00 G49 G40.1 G17
G80 G50 G90 G98
G20 (Inch)
G52 Z0.003
M98 P1
G52 Z0.006
M98 P1
G52 Z0.009
M98 P1
G52 Z0
G00 Z-0.01
S1300
G04 P2000
G01 X-6 F10
S0
G04 P1000
G00 Z0.5
G01 x0 F200
M30
O1
S1300
G04 P2000
G01 X-6 F30
S0
G04 P1000
G00 Z0.5
G01 x0 F200
G00 Z0
M99
%
I'm sure my code is fundamentally flawed, but if you know what I've missed I would appreciate knowing!
Thanks!
G00 G49 G40.1 G17
G80 G50 G90 G98
G20 (Inch)
G52 Z0.003
M98 P1
G52 Z0.006
M98 P1
G52 Z0.009
M98 P1
G52 Z0
G00 Z-0.01
S1300
G04 P2000
G01 X-6 F10
S0
G04 P1000
G00 Z0.5
G01 x0 F200
M30
O1
S1300
G04 P2000
G01 X-6 F30
S0
G04 P1000
G00 Z0.5
G01 x0 F200
G00 Z0
M99
%
I'm sure my code is fundamentally flawed, but if you know what I've missed I would appreciate knowing!
Thanks!