[object Object]Engineering Information, Conversions and Calculations

G And M Codes

“G” stands for Geometry; hence, the G-Code commands are responsible for the movements of the machine that create the geometry of the part.

“M” stands for Machine (or Miscellaneous), and the M-Codes are responsible for Machine commands that cause particular operations of the equipment. Unlike G-codes, which can appear multiple times on the same line, M-Code is limited to one code per line.

G-CODEGROUPFUNCTION
G011Linear Interpolation Motion (X,Y,Z,A,B,F)
G021Circular Interpolation Motion CW (X,Y,Z,A,I,J,K,R,F)
G031Circular Interpolation Motion CCW (X,Y,Z,A,I,J,K,R,F)
G040Dwell (P) (P =seconds"."milliseconds)
G090Exact Stop, Non-Modal
G100Programmable Offset Setting (X,Y,Z,A,L,P,R)
G120Circular Pocket Milling CW (Z,I,K,Q,D,L,F)
G130Circular Pocket Milling CCW (Z,I,K,Q,D,L,F)
G17*2Circular Motion XY Plane Selection (G02 or G03) (Setting 56)
G182Circular Motion ZX Plane Selection (G02 or G03)
G192Circular Motion YZ Plane Selection (G02 or G03)
G20*6Verify Inch Coordinate Positioning (Setting 9 will need to be INCH) (Setting 56)
G216Verify Metric Coordinate Positioning (Setting 9 will need to be METRIC)
G280Machine Zero Return Thru Reference Point (X,Y,Z,A,B) (Setting 108)
G290Move to location Thru G28 Reference Point (X,Y,Z,A,B)
G31**0Feed Until Skip Function (X,Y,Z,A,B,F)
G35**0Automatic Tool Diameter Measurement (D,H,Z,F)
G36**0Automatic Work Offset Measurement (X,Y,Z,A,B,I,J,K,F)
G37**0Automatic Tool Offset Measurement (D,H,Z,F)
G40*7Cutter Compensation Cancel G41/G42/G141 (X,Y) (Setting 56)
G4172D Cutter Compensation Left (X,Y,D) (Setting 43, 44, 58)
G4272D Cutter Compensation Right (X,Y,D) (Setting 43, 44, 58)
G438Tool Length Compensation + (H,Z) (Setting 15)
G448Tool Length Compensation - (H,Z) (Setting 15)
G470Text Engraving (X,Y,Z,R,I,J,P,E,F) (Macro Variable #599 to Change Serial number)
G49*8Tool Length Compensation Cancel G43/G44/G143 (Setting 56)
G50*11Scaling G51 Cancel (Setting 56)
G51**11Scaling (X,Y,Z,P) (Setting 71)
G5212Select Work Coordinate System G52 (Setting 33, YASNAC)
G520Global Work Coordinate System Shift (Setting 33, FANUC)
G520Global Work Coordinate System Shift (Setting 33, HAAS)
G530Machine Zero XYZ Positioning, Non-Modal
G54*12Work Offset Positioning Coordinate #1 (Setting 56)
G5512Work Offset Positioning Coordinate #2
G5612Work Offset Positioning Coordinate #3
G5712Work Offset Positioning Coordinate #4
G5812Work Offset Positioning Coordinate #5
G5912Work Offset Positioning Coordinate #6
G600Uni-Directional Positioning (X,Y,Z,A,B) (Setting 35)
G6113Exact Stop, Modal (X,Y,Z,A,B)
G64*13Exact Stop G61 Cancel (Setting 56)
G65**0Macro Sub-Routine Call
G66**0Modal Mode for Macro Sub-Routine Call
G67**0Cancel Modal Mode for Macro Sub-Routine Call
G68**16Rotation (G17,G18,G19,X,Y,Z,A,R) (Setting 72, 73)
G69*16Rotation G68 Cancel (Setting 56)
G700Bolt Hole Circle with a Canned Cycle (,I,J,L)
G710Bolt Hole Arc with a Canned Cycle (,I,J,K,L)
G720Bolt Holes Along an Angle with a Canned Cycle (,I,J,L)
G739High Speed Peck Drill Canned Cycle (X,Y,A,B,Z,I,J,K,Q,P,R,L,F) (Setting 22)
G749Reverse Tapping Canned Cycle (X,Y,A,B,Z,R,J,L,F) (Setting 130, 133)
G769Fine Boring Canned Cycle (X,Y,A,B,Z,I,J,P,Q,P,R,L,F) (Setting 27)
G779Back Bore Canned Cycle(X,Y,A,B,Z,I,J,Q,R,L,F) (Setting 27)
G80*9Cancel Canned Cycle (Setting 56)
G819Drill Canned Cycle (X,Y,A,B,Z,R,L,F)
G829Spot Drill / Counterbore Canned Cycle (X,Y,A,B,Z,P,R,L,F)
G839Peck Drill Deep Hole Canned Cycle (X,Y,A,B,Z,I,J,K,Q,P,R,L,F) (Setting 22, 52)
G849Tapping Canned Cycle (X,Y,A,B,Z,R,J,L,F) (Setting 130, 133)
G859Bore in~Bore out Canned Cycle (X,Y,A,B,Z,R,L,F)
G869Bore in~Stop~Rapid out Canned Cycle (X,Y,A,B,Z,R,L,F)
G879Bore in~Manual Retract Canned Cycle (X,Y,A,B,Z,R,L,F)
G889Bore~Dwell~Manual Retract Canned Cycle (X,Y,A,B,Z,P,R,L,F)
G899Bore~Dwell~Bore out Canned Cycle (X,Y,A,B,Z,R,L,F)
G90*3Absolute Positioning Command (Setting 56)
G913Incremental Positioning Command (Setting 29)
G920Set Work Coordinate Value (Fanuc) (HAAS)
G920Global Work Coordinate System Shift (Yasnac)
G935Inverse Time Feed Mode ON
G94*5Inverse Time Feed Mode OFF/Feed Per Minute ON (Setting 56)
G955Feed Per Revolution
G98*10Canned Cycle Initial Point Return (Setting 56)
G9910Canned Cycle "R" Plane Return
G1000Mirror Image Cancel
G1010Mirror Image (X,Y,Z,A,B) (Setting 45, 46, 47, 48, 80)
G1020Programmable Output to RS-232 (X,Y,Z,A,B)
G1030Limit Block Look-a-head (P0-P15 for number of lines control looks ahead)
G1070Cylindrical Mapping (X,Y,Z,A,Q,R)
G11012Work Offset Positioning Coordinate #7
G11112Work Offset Positioning Coordinate #8
G11212Work Offset Positioning Coordinate #9
G11312Work Offset Positioning Coordinate #10
G11412Work Offset Positioning Coordinate #11
G11512Work Offset Positioning Coordinate #12
G11612Work Offset Positioning Coordinate #13
G11712Work OffsetPositioning Coordinate #14
G11812Work Offset Positioning Coordinate #15
G11912Work Offset Positioning Coordinate #16
G12012Work Offset Positioning Coordinate #17
G12112Work Offset Positioning Coordinate #18
G12212Work Offset Positioning Coordinate #19
G12312Work Offset Positioning Coordinate #20
G12412Work Offset Positioning Coordinate #21
G12512Work Offset Positioning Coordinate #22
G12612Work Offset Positioning Coordinate #23
G12712Work Offset Positioning Coordinate #24
G12812Work Offset Positioning Coordinate #25
G12912Work Offset Positioning Coordinate #26
G136**0Automatic Work Offset Center Measurement
G14173D+ Cutter Compensation (X,Y,Z,I,J,K,D,F)
G143**85 Axis Tool Length Compensation+ (X,Y,Z,A,B,H) (Setting 117)
G1500General Purpose Pocket Milling (X,Y,P,,Z,I,J,K,Q,D,R,L,S,F)
G153**95 Axis High Speed Peck Drill Canned Cycle (X,Y,A,B,Z,I,J,K,Q,P,E,L,F) (Setting 22)
G1549Select Work Offset Positioning Coordinate P1-99
G155**95 Axis Reverse Tapping Canned Cycle (X,Y,A,B,Z,J,E,L,F)
G161**95 Axis Drill Canned Cycle (X,Y,A,B,Z,E,L,F)
G162**95 Axis Spot Drill/Counterbore Canned Cycle (X,Y,A,B,Z,P,E,L,F)
G163**95 Axis Peck Drill Canned Cycle (X,Y,A,B,Z,I,J,K,Q,E,L,F) (Setting 22)
G164**95 Axis Tapping Canned Cycle (X,Y,A,B,Z,J,E,L,F)
G165**95 Axis Bore in, Bore out Canned Cycle (X,Y,A,B,Z,E,L,F)
G166**95 Axis Bore in, Stop, Rapid out Canned Cycle (X,Y,A,B,Z,E,L,F)
G169**95 Axis Bore, Dwell, Bore out Canned Cycle (X,Y,A,B,Z,P,E,L,F)
G1740Special Purpose Non-Vertical Rigid Tapping CCW (X,Y,Z,F)
G1840Special Purpose Non-Vertical Rigid Tapping CW (X,Y,Z,F)
G1870Accuracy Control for High Speed Machining (E)
G1880Get Program From PST (Program Schedule Table)
* = Defaults
** = Optional
M-CODESFUNCTION
M00The M00 code is used for a Program Stop command on the machine.

It stops the spindle, turns off coolant and stops look-a-head processing.

Pressing CYCLE START again will continue the program on the next block of the program.

M01The M01 code is used for an Optional Program Stop command.
Pressing the OPT STOP key on the control panel signals the machine

toperform a stop command when the control reads an M01 command.

It will then perform like an M00.

M03Starts the spindle CLOCKWISE. Must have a spindle speed defined.
M04Starts the spindle COUNTERCLOCKWISE. Must have a spindle speed defined.
M05STOPS the spindle.
M06Tool change command along with a tool number will execute a tool change for that tool.

This command will automatically stop the spindle, Z-axis will move up to the machine

zero position and the selected tool will be put in spindle.

The coolant pump will turn off right before executing the tool change.

M08Coolant ON command.
M09Coolant OFF command.
M30Program End and Reset to the beginning of program.
M97Local Subroutine call
M98Subprogram call
M99Subprogram return (M98) or Subroutine return (M97), or a Program loop.

NOTE: Only one "M" code can be used per line. And the M-codes will be the last command to be executed in a line, regardless of where it's located in that line.

Affiliate Partners

Help support us by using our affiliate links below.

Amazon.com affiliate link
Amazon.co.uk affiliate link
Ebay.co.uk affiliate link

Social Links