MyT'Mill for Windows

Simple but powerful CAM software

  G&M Code Guide
Code Supported Meaning
A,B,C Yes* Auxiliary Axis, *A supported
D Yes Offset CRC
E No IPR Feedrate
F Yes IPM/IPR Feedrate
G0/G00 Yes Non-Linear Rapid moves
G1/G01 Yes Linear Interpolation
G2/G02 Yes CW Interpolation
G3/G03 Yes CCW Interpolation
G4/G04 Yes Dwell
G17 Yes X,Y Plane of Interpolation
G18 Yes X,Z Plane of Interpolation
G19 Yes Y,Z Plane of Interpolation
G28 Yes Return to Machine zero
G40 Yes CRC cancel
G41 Yes CRC left
G42 Yes CRC right
G43 No Tool length comp. +
G44 No Tool length comp. -
G49 No Tool Length comp. Cancel
G50 Yes Set Program Zero
G54-G59 No Set Local Coordinate Systems
G70 No Rough turning canned cycle
G71 No Finishing turning canned cycle
G73 No Drill CHPBRKR
G80 Yes Canned Cycle cancel
G81 Yes Spot Drilling Cycle
G82 No Drill/Counterbore
G83 Yes Peck Drilling Cycle
G85 No Bore
G90 Yes Absolute Programming
G91 Yes Incremental Programming
G92 Yes Set Program Zero
G94 No IPM Programming
G95 No IPR Programming
G97 No Direct Spindle Speed Programming
G98 Yes Return to initial level
G99 Yes Return to R level
H No Tool length offset call
I,J,K Yes Arc center location
MO/MOO Yes Program stop
M1/M01 Yes Optional stop
M2/M02 Yes Program stop
M3/M03 No Spindle normal rotation
M4/M04 No Spindle reverse rotation
M5/M05 No Spindle off
M6/M06 No Tool change
M8/M08 No Coolant on
M9/M09 No Coolant off
M30 Yes Program reset/tape rewind
M98 Yes Sub-Program call
M99 Yes Return to previous program
N Yes Sequence Numbers
O Yes Program Numbers
P Yes Dwell time
Q No Peck Depth
R Yes Rapid level
R Yes Arc center radius
S No Spindle speed
T No Tool number
U,V,W No Incremental Move in X, Y, Z
X,Y,Z Yes Absolute Move in X, Y, Z

 
Supported G&M code examples
Example
G0 X-1.780 Y-1.025 Z0.1

Description
Moves the tool to location (-1.78,-1.025,0.1) at the move speed specified in Setup|CNC defaults.  The Z axis will be moved first.

Example
G1 X0.939
X0.948 Y0.333

Description
Moves the tool along the X axis to location (0.939) at the feed speed specified in Setup|CNC defaults.  Then moves the tool to location (0.948, 0.333).

Example
G1 X0.948 Y0.333 F2.5

Description
Moves the tool to location (0.948,0.333) at speed 2.5.  Any subsequent G1 commands or coordinates will continue to use speed of 2.5 until you set it to some other value or you cancel the F command.  To cancel the F command, use F0.  This will reset the feed speed to the value in the Setup|CNC Defaults form.  If you specify a speed higher than the MaxSpeed value specified in the Setup|Motor Parameters form, the MaxSpeed value will be used instead.

Example
G2 X-1.535 Y0.469 I0.500 J0.000

Description
Move in a clockwise arc from the current position to location (-1.535, 0.469) using a center point located 0.5 units in the X direction from the current position.

Example
G3 X-1.535 Y0.469 I-0.500 J0.000

Description
Move in a counter-clockwise arc from the current position to location (-1.535, 0.469) using a center point located 0.5 units in the negative X direction from the current position.

Example
G4 P2000

Description
Pause the tool for 2 seconds (2000 milliseconds) before continuing.

Example
G27

Description
Rapid return home.  Move directly to location (0, 0, 0) at the move speed specified in Setup|GNC Defaults.

Example
G28 X0.5 Y-.2 Z.1

Description
Rapid return home via point.  Move directly to location (0.5, -0.2, 0.1) at the default move speed, then move directly home to location (0, 0, 0).

Example
G50 X0.5 Y-.2 Z.1

Description
Redefine the tools current location to be (0.5, -0.2, 0.1).

Example
G81
D .125
M1
X-0.470 Y0.597 Z-0.030 L0.01
G80

Description
Start Drill cycle with G81.  D parameter specifies drill bit radius (not diameter) of 0.125.  Pause program with M1 command giving you time to load a drill bit.  Manually adjust the tool depth so that the tip of the new drill bit is at the same depth as the one removed.  When you are ready, click the Continue button.  The tool moves up to Zsafe defined in Setup|GNC Defaults form.  Then it moves to location (-0.47, 0.597) at the default move speed.  Then it moves down to 0.01 at the default move speed.  Then it moves down to the Z depth of 0.030 at the default feed speed.  If you leave out the L coordinate, it will travel at the feed speed from Zsafe to the Z depth.  Subseqent X,Y coordinates will drill new holes at the new coordinates.  The tool will lift up before moving to the next hole.  Finally, drill cycle is cancelled with G80.

Example
G83
D .125
M1
X-0.470 Y0.597 Z-1 L0.01 Q.3
G80

Description
Start Peck Drill cycle with G83.  D parameter specifies drill bit radius (not diameter) of 0.125.  Pause program with M1 command giving you time to load a drill bit.  Manually adjust the tool depth so that the tip of the new drill bit is at the same depth as the one removed.  When you are ready, click the Continue button. 
1) The tool moves up to Zsafe defined in Setup|GNC Defaults form. 
2) Moves to location (-0.47, 0.597) at the default move speed.
3) Moves down to 0.01 at the move speed. If L parameter not defined, it will use Zsafe.
4) Moves down another 0.3 units at the default feed speed  If Q parameter not defined, it will use 2 times the drill bit diameter.
5) Moves back up to 0.01 at move speed. 
6) Moves down to within one radius of previous depth at move speed
7) Moves down another 0.3 units at feed speed
8) Repeats steps 5-7 until Z depth of 1.0 has been reached
9) Moves up to 0.01 at move speed
10) Subseqent X,Y coordinates will peck drill new holes at the new coordinates.  The tool will lift up to Zsafe before moving to the next hole. 
11) Finally, drill cycle is cancelled with G80.

Example
G98

Description
Move Z axis to depth set in L code at the default move speed defined in Setup|GNC defaults form.

Example
G99

Description
Move Z axis to depth set in R code at the default move speed defined in Setup|GNC defaults form.

Example
M0

Description
Stop program

Example
M30

Description
Reset program back to the top and start running again from there