Mach4 g-code help

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

gld

Well-Known Member
HMEM Supporting Member
Joined
Jun 18, 2009
Messages
176
Reaction score
89
Location
Tarkio, Missouri
If you delete the code in red , the program will execute 3 times and stop. I need to advance X by .063 thou and have the X readout show the advance.
I thought formulas were allowed in code, but I guess not. This code will run continuously until a stop is activated.

The sub is a lot longer than posted here. Just trying to save space here.

(Tool 1 = 1/32" End Mill)
N0001 G90
N0003 G01 X0 Y0 Z0.0500 F20
N0010 M98 P1000 L3
N10

G0 X=X+0.063

M30

O1000 (Subprogram)
N0002 G90
N0003 M03
N0004 G01
N0007 Y0.0000 Z0.0500 F20
N0009 Y0.0000 Z0.0500
N0011 Y0.0000 Z-0.0250
N0013 Y0.5000 Z-0.0250
N0015 Y0.5000 Z-0.0500
N0017 Y0.0000 Z-0.0500
N0019 Y0.0000 Z-0.0750
N0021 Y0.5000 Z-0.0750
N0035 Y0.5000 Z-0.0900
N0037 Y0.0000 Z-0.0900
N0039 Y0.0000 Z0.0500
N0011 G91 G0 A90 F60
N0013 G90 G01 F20
N0060 M99 P10
 
Try using "U" instead of "X" for an incremental movement. Eg. G0 U-.063 instead of X-.063.
 

Latest posts

Back
Top