G-Codes (Preparatory Codes) – FANUC Standard
G-Code Function Description
G00 Rapid Positioning Moves the tool quickly (non-cutting).
Cutting move in a straight line at
G01 Linear Interpolation
feedrate.
G02 Circular Interpolation (CW) Clockwise circular cutting.
G03 Circular Interpolation (CCW) Counter-clockwise circular cutting.
Pause for a specified time (P =
G04 Dwell
milliseconds).
G10 Programmed Offset Input Sets tool/work offsets within program.
G17 XY Plane Selection Plane for circular interpolation.
G18 ZX Plane Selection Plane for circular interpolation.
G19 YZ Plane Selection Plane for circular interpolation.
G20 Inch Mode Sets units to inches.
G21 Metric Mode Sets units to millimeters.
Moves to machine zero (via
G28 Return to Reference
intermediate point).
G40 Cancel Cutter Compensation Cancels G41/G42.
Used for tool radius compensation on
G41 Cutter Compensation Left
left.
G42 Cutter Compensation Right Tool offset on right.
G43 Tool Length Compensation + Positive tool length offset.
G44 Tool Length Compensation - Negative tool length offset.
G49 Cancel Tool Length Offset Cancels G43/G44.
Moves in machine coordinates (not
G53 Machine Coordinate Positioning
work offset).
Select different workpiece coordinate
G54 - G59 Work Coordinate Systems
systems.
G73 Peck Drilling Cycle High-speed peck drilling.
G76 Threading Cycle Used for lathe threading operations.
G80 Cancel Canned Cycle Ends drilling cycles.
G81 Drilling Cycle Simple drilling cycle.
G82 Drilling with Dwell Adds dwell time at bottom.
G83 Deep Hole Peck Drilling Drill pecking deeper with chip clearing.
G84 Tapping Cycle (RH) Right-hand tapping.
G85 Boring Cycle Feed in, then retract without dwell.
G90 Absolute Programming All positions relative to origin.
G91 Incremental Programming All positions relative to current position.
G92 Set Position Sets coordinate zero point.
G94 Feed per Minute Feed rate in mm/min or inch/min.
G95 Feed per Revolution Feed rate per spindle rev (lathe use).
For turning - keeps cutting speed
G96 Constant Surface Speed
constant.
G97 Cancel CSS Switch to RPM mode.
G98 Return to Initial Point Used in canned cycles.
G99 Return to R Point Used in canned cycles.
M-Codes (Miscellaneous Codes) – FANUC Standard
M-Code Function
M00 Program Stop (Operator Resume)
M01 Optional Stop (if enabled)
M02 End of Program
M03 Spindle ON (Clockwise)
M04 Spindle ON (Counter-clockwise)
M05 Spindle Stop
M06 Tool Change
M08 Coolant ON
M09 Coolant OFF
M10 Chuck Clamp / Pallet Clamp
M11 Chuck Unclamp / Pallet Unclamp
M17 Subprogram End
M30 Program End & Reset
M98 Call Subprogram
M99 Return from Subprogram or Loop