Posted on Leave a comment

G code and M code

G codes: A G code in CNC programming controls the movements of a machine, dictating how and where a machine should move to fabricate a part. M codes: An M code in CNC programming controls miscellaneous machine functions, including starting and stopping specific actions or programs.

A list of gcodes and mcodes for milling in the Fanuc control system.



G code system





G00 G00 G00 Positioning (Rapid traverse)
G01 G01 G01 Linear interpolation (Cutting feed)
G02 G02 G02 Circular interpolation CW or helical interpolation CW
G03 G03 G03 Circular interpolation CCW or helical interpolation CCW
G04 G04 G04 Dwell
G10 G10 G10 Programmable data input
G10.6 G10.6 G10.6 Tool retract and recover
G11 G11 G11 Programmable data input mode cancel
G17 G17 G17 XpYp plane selection
G18 G18 G18 ZpXp plane selection
G19 G19 G19 YpZp plane selection
G20 G20 G70 Input in inch
G21 G21 G71 Input in mm
G22 G22 G22 Stored stroke check function on
G23 G23 G23 Stored stroke check function off
G25 G25 G25 Spindle speed fluctuation detection off
G26 G26 G26 Spindle speed fluctuation detection on
G27 G27 G27 Reference position return check
G28 G28 G28 Return to reference position
G28.2 G28.2 G28.2 In-position check disable reference position return
G29 G29 G29 Movement from reference position
G30 G30 G30 2nd, 3rd and 4th reference position return
G31 G31 G31 Skip function
G32 G33 G33 Threading
G34 G34 G34 Variable lead threading
G35 G35 G35 Circular threading CW






Circular threading CCW (When bit 3 (G36) of parameter No. 3405 is set to 1) or Automatic tool offset (X axis) (When bit 3 (G36) of parameter No. 3405 is set to 0)
G37 G37 G37 Automatic tool offset (Z axis) (When bit 3 (G36) of parameter

No. 3405 is set to 0)

G38 G38 G38 Tool radius/tool nose radius compensation: with vector held
G39 G39 G39 Tool radius/tool nose radius compensation: corner rounding interpolation
G40 G40 G40 Tool radius/tool nose radius compensation : cancel
G41 G41 G41 Tool radius/tool nose radius compensation : left
G42 G42 G42 Tool radius/tool nose radius compensation : right
G50 G92 G92 Coordinate system setting or max spindle speed clamp
G52 G52 G52 Local coordinate system setting
G53 G53 G53 Machine coordinate system setting
G54 G54 G54 Workpiece coordinate system 1 selection
G55 G55 G55 Workpiece coordinate system 2 selection
G56 G56 G56 Workpiece coordinate system 3 selection
G57 G57 G57 Workpiece coordinate system 4 selection
G58 G58 G58 Workpiece coordinate system 5 selection
G59 G59 G59 Workpiece coordinate system 6 selection
G61 G61 G61 Exact stop mode
G62 G62 G62 Automatic corner override mode
G63 G63 G63 Tapping mode
G64 G64 G64 Cutting mode
G65 G65 G65 Macro call
G66 G66 G66 Macro modal call A
G67 G67 G67 Macro modal call A/B cancel
G68 G68 G68 Mirror image on for double turret or balance cutting mode
G70 G70 G72 Finishing cycle
G71 G71 G73 Stock removal in turning
G72 G72 G74 Stock removal in facing
G73 G73 G75 Pattern repeating cycle
G74 G74 G76 End face peck drilling cycle
G75 G75 G77 Outer diameter/internal diameter drilling cycle
G76 G76 G78 Multiple-thread cutting cycle
G71 G71 G72 Traverse grinding cycle
G72 G72 G73 Traverse direct sizing/grinding cycle
G73 G73 G74 Oscillation grinding cycle
G74 G74 G75 Oscillation direct sizing/grinding cycle
G80 G80 G80 Canned cycle cancel for drilling
G81 G81 G81 Spot drilling (FS10/11-T format)
G82 G82 G82 Counter boring (FS10/11-T format)
G83 G83 G83 Peck drilling cycle
G84 G84 G84 Cycle for face tapping
G85 G85 G85 Cycle for face boring
G87 G87 G87 Cycle for side drilling
G88 G88 G88 Cycle for side tapping
G89 G89 G89 Cycle for side boring
G90 G77 G20 Outer diameter/internal diameter cutting cycle
G92 G78 G21 Threading cycle
G94 G79 G24 End face turning cycle
G91 G91 G91 Incremental programming
G96 G96 G96 Constant surface speed control
G97 G97 G97 Constant surface speed control cancel
G98 G94 G94 Feed per minute
G99 G95 G95 Feed per revolution
G90 G90 Absolute programming
G98 G98 Canned cycle : return to initial level
G99 G99 Canned cycle : return to R point level


M00 Programmed Pause M01 Optional Stop
M02 End Of Program M03 Turn Spindle On Clockwise Direction
M04 Turn Spindle On Counter Clockwise Direction M05 Stop Spindle
M06 Tool Change M08 Coolant On (Turns Accessory 1 On)
M09 Coolant Off (Turns Accessory 1 Off) M10  Run Chip Conveyor 1 Forward Continuous
M11 Run Chip Conveyor 1 Forward Intermittent M12 Stop Chip Conveyor 1
M13 Start Washing Piece For Additional Pump M14 Stop Washing Piece For Additional Pump
M15 Run Chip Conveyor 1 Backward One Time M16 Run Chip Conveyor 2 Backward One Time
M19 Spindle Orientation M20 Run Chip Conveyor 2 Forward Continuous
M21 Run Chip Conveyor 2 Forward Intermitent M31   Laser Tool On (Marposs Opt.)
M32 Laser Tool Off (Marposs Opt.) M33 Laser Dynamic Active On (Marposs Opt.)
M34 Laser Dynamic Active Off (Marposs Opt.) M41  Insert Low Gear
M42 Insert High Gear (Only For Quill) M50 Reserved Exit Counts Pieces Client (Opt.)
M51 Reserved Exit Counts Pieces Client (Opt.) M52 Probe On (Opt.)
M53 Probe Off (Opt.) M54 Probe No Touch (Opt.)
M55 Tool Monitor On (Opt.) M56 Tool Monitor Off (Opt.)
M58 Pallet Loading With Empty Table B M59 Pallet Unloading From Table B & Cycle Finish
M60 Fallet Chang (1-2, 2-1) M66 Pallet Change(1-1, 2-2)
M61 Tool Change Into Inner Pocket Of Cross Feed Head M62 Tool Change Into Outer Pocket Of Cross Feed Head
M63 Tool Change Into High Speed Head(Quill) M70 Retract Quill
M71   Advance Quill M98 Sub-Program Call
M99 End & Return To Main Program M110 Clamp X Axis (Opt)
M111 Unclamp X Axis (Opt) M112 Clamp Y Axis (Opt)
M113 Unclamp Y Axis (Opt) M114 Clamp X, Y Axis Together (Opt)
M115 Unclamp X & Y Axis Together (Opt)


Leave a Reply

Your email address will not be published. Required fields are marked *