Fanuc M-Code G-Code list

M-CODE

Introduction to G Codes and M Codes

Fanuc M-Code G-Code, G codes (preparatory commands) and M codes (auxiliary commands) are essential instructions used to control machine tools.

  • G codes govern motion, positioning, and machining operations (e.g., linear interpolation, circular movements, tool compensation).
  • M codes manage auxiliary functions (e.g., spindle control, coolant activation, tool changes).

These Fanuc M-Code G-Code vary slightly depending on the machine type (lathe, mill, etc.) and Fanuc control version. Always consult your machine’s manual for specifics.


Common Fanuc G Codes

Machining Centers

CodeDescription
G00Rapid positioning (fast traverse)
G01Linear interpolation (straight-line motion)
G02Circular interpolation (clockwise)
G03Circular interpolation (counterclockwise)
G04Dwell (pause)
G05non standard g-code
G17XY plane selection
G18XZ plane selection
G19YZ plane selection
G20Programming in inches
G21Programming in millimeters
G22
G28Return to reference position (home)
G29Return from reference point
G30Return to secondary reference position
G40Cancel tool radius compensation
G41Tool radius compensation left
G42Tool radius compensation right
G43Tool length compensation (positive)
G44Tool length compensation (negative)
G49Cancel tool length compensation
G54–G59Work coordinate system (WCS) selection
G61Exact stop check (precision mode)
G90Absolute programming
G91Incremental programming
G92Set position by programming
G94Per-minute feedrate mode
G95Per-revolution feedrate mode
G100–G199Macro programs (varies by configuration)

LATHES

CodeDescription
G00Rapid positioning (fast traverse)
G01Linear interpolation (straight-line motion)
G02Circular interpolation (clockwise)
G03Circular interpolation (counterclockwise)
G04Dwell (pause)
G05non standard g-code
G10Data setting
G11Data setting mode cancel
G15Polar coordinates command cancel
G16Polar coordinates command
G17XY plane selection
G18XZ plane selection
G19YZ plane selection
G20Programming in inches
G21Programming in millimeters
G22Stored stroke check function on
G23Stored stroke check function off
G27Reference point return check
G28Return to reference position (home)
G30Return to secondary reference position
G40Cancel tool radius compensation
G41Tool radius compensation left
G42Tool radius compensation right
G43Tool length compensation (positive)
G44Tool length compensation (negative)
G49Cancel tool length compensation
G54–G59Work coordinate system (WCS) selection
G61Exact stop check (precision mode)
G90Absolute programming
G91Incremental programming
G92Set position by programming
G94Per-minute feedrate mode
G95Per-revolution feedrate mode
G100–G199Macro programs (varies by configuration)

Common Fanuc M Codes

CodeDescription
M00Program stop
M01Optional stop
M02Program end
M03Spindle on (clockwise)
M04Spindle on (counterclockwise)
M05Spindle stop
M06Tool change
M07Mist coolant on (air cooling)
M08Flood coolant on
M09Cooling (air cooling, water cooling, central outlet) OFF
M10Chuck CLAMP
M11Chuck UNCLAMP
M12QUILL OUT
M13 QUILL IN / 4th axls clamp
M14 4th axls unclamp
M15 5th axls clamp
M16 5th axls unclamp
M17AUTO DOOR CLOSE
M18AUTO DOOR OPEN
M19Spindle orientation
M20Open tool magazine door
M21Close tool magazine door
M23 CHAMFERING ON / Main shaft center water opening
M24CHAMFERING OFF / Main shaft center water outlet is closed
M25LNS BAR FEEDER EXTEND
M26BAR FEEDER ON
M27BAR FEEDER OFF
M28PART CATCHER EXTEND / Enable external data input
M29PART CATCHER RETRACT / Disable external data input
M30Program end and return to start
M31CHUCK BYPASS ON
M32CHUCK BYPASS OFF
M37CHIP CONVEYOR CW
M38CHIP CONVEYOR STOP
M43SETTER DOWN
M44SETTER UP
M47SOFT LIMIT 2 VALID
M48SOFT LIMIT 3 VALID
M49SOFT LIMIT 2/3 UNVALID
M41–M49Tool changer preparation
M51ERROR DETECT OFF
M52ERROR DETECT ON
M53STEADY CLAMP
M54STEADY UNCLAMP
M55TAIL STOCK CLAMP
M56TAIL STOCK UNCLAMP
M61–M69Tool selection (machine-specific)
M79 Tool reset (suitable for arm type tool store)
M97PARTS COUNTED
M98Subprogram call
M99Subprogram return
M100–M199Customizable codes (user-defined)

Notes

  1. Variations: Codes may differ by machine manufacturer or Fanuc control version.
  2. Documentation: Always refer to your machine’s manual for exact code definitions.
  3. Compatibility: Codes depend on the machine type (e.g., lathe vs. mill).

For exhaustive lists of Fanuc M-Code G-Code, consult Fanuc technical manuals or your machine’s programming guide.


Discover more from digit chain

Subscribe to get the latest posts sent to your email.

Leave a Reply

Scroll to Top