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

Some G codes are not avialable depending on kind of CNC

CodeDescription
G00Rapid positioning (fast traverse)
G01Linear interpolation (straight-line motion)
G02Circular interpolation (clockwise)
G03Circular interpolation (counterclockwise)
G04Dwell (pause)
G05High-speed cycle machining
G09Exact stop
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)
G29Return from reference position
G30Return to secondary reference position
G31Skip fonction
G33Treading
G39Corner offset circular interpolation
G40Cancel tool radius compensation
G41Tool radius compensation left
G42Tool radius compensation right
G43Tool length compensation (positive)
G44Tool length compensation (negative)
G45Tool offset extension
G46Tool offset reduction
G47Double extension of tool offset
G48Tool offset reduction by half
G49Cancel tool length compensation
G50Scaling cancel
G51Scaling
G52Local coordinate system setting
G53selection of machine coordinate system
G54–G59Work coordinate system (WCS) selection
G60Unidirectional positioning
G61Exact stop check (precision mode)
G62automatic corner override
G63Tapping mode
G64Cutting mode
G65Macrocommand, macro call
G66Custom macro modal call
G67Custom macro modal call cancel
G68Coordinate rotation
G69Coordinate rotation cancel
G70Finish cycle
G71Rough cutting cycle of outer diameter
G72Rough cutting cycle end face
G73Peck drilling cycle
G74Counter tapping cycle
G75Outer inner diameter cutting off cycle
G76multiple threading cycle
G80Canned cycle cancel
G81Drilling cycle, spot boring
G82Drilling cycle, counter boring
G83Peck drilling cycle
G84Tapping cycle
G85Boring cycle
G86Boring cycle
G87Back boring cycle
G88Boring cycle
G89Boring cycle
G90Absolute programming
G91Incremental programming
G92Set coordinate system by programming
G94Per-minute feedrate mode
G95Per-revolution feedrate mode
G96Constant surface speed control
G97Constant surface speed control cancel
G98Return to initial point
G99Return to R point
G100–G199Macro programs (varies by configuration)

Common Fanuc M Codes

lathe

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)

Mori Seiki

ZL-15S, ZL-15SM, ZL-15SMC
Contrôleur : FS-OTTB

M CODEFUNCTION
M00PROGRAM STOP
M01OPTIONAL STOP
M02END OF PROGRAM
M03NORMAL SPINDLE ROTATION
M04REVERSE SPINDLE ROTATION
M05SPINDLE STOP
M08COOLANT PUMP ON
M09COOLANT PUMP OFF
M10CHUCK CLAMP
M11CHUCK UNCLAMP
M13NORMAL MILLING ROTATION
M14REVERSE MILLING ROTATION
M17NORMAL TURRET ROTATION
M18REVERSE TURRET ROTATION
M19SPINDLE ORIENTATION
M20SPINDLE ORIENTATION CANCEL
M23CHAMFERING ON
M24CHAMFERING OFF
M28IN-POSITION CHECK ON
M29IN-POSITION CHECK OFF
M30RESET & REWIND
M31INTERLOCK BY-PASS ON
M32INTERLOCK BY-PASS OFF
M35SYNCHRONOUS OPERATION ON
M36SYNCHRONOUS OPERATION OFF
M45C-AXIS CONNECTION ON
M46C-AXIS CONNECTION OFF
M48OVERRIDE CANCEL ON
M49OVERRIDE CANCEL OFF
M51AIR BLOW ON
M52SPINDLE AIR BLOW 2 ON
M53SENSOR AIR BLOW ON
M57SPINDLE AIR BLOW 2 OFF
M58SENSOR AIR BLOW OFF
M59AIR BLOW OFF
M60EXTERNAL M-CODE OUTPUT
M61EXTERNAL M-CODE OUTPUT
M62EXTERNAL M-CODE OUTPUT
M63EXTERNAL M-CODE OUTPUT
M64EXTERNAL M-CODE OUTPUT
M65EXTERNAL M-CODE OUTPUT
M66EXTERNAL M-CODE OUTPUT
M67EXTERNAL M-CODE OUTPUT
M68SPINDLE BRAKE CLAMP
M69SPINDLE BRAKE UNCLAMP
M70BAR FEEDER OUT
M71PRESETTER UP
M72PRESETTER DOWN
M73PARTS CATCHER OUT
M74PARTS CATCHER IN
M75X-AXIS MIRROR IMAGE OFF
M76X-AXIS MIRROR IMAGE ON
M77WORK CHUCKING DETECTION
M80CUTTING-OFF DETECTION
M81HIGH PRESSURE BRAKE ON
M832-STEP CLAMPING PRESSURE SYSTEM FOR CHUCK OFF
M842-STEP CLAMPING PRESSURE SYSTEM FOR CHUCK ON
M85AUTO DOOR OPEN
M86AUTO DOOR CLOSE
M87AIR-BLOW 2 ON
M88AIR-BLOW 2 OFF
M89WORK-COUNTER
M90SPINDLE/ROTARY TOOL SIMULTANEOUS OPERATION ON
M91SPINDLE/ROTARY TOOL SIMULTANEOUS OPERATION OFF

Dual-spindle CNC lathe

BIGLIA B.500/SM

M-CodeFunctionDescription
M00PROGRAM STOPUnconditional program stop. Spindle, feed axes and coolant are switched off. Cycle is resumed by pressing CYCLE START at the operator panel. Used for part reversal, manual gauging, or intermediate inspection steps during the machining cycle.
M01OPTIONAL STOPConditional stop active only when the “Optional Stop” switch on the operator panel is set to ON. Allows quality-check breakpoints to be inserted without modifying the part program. Widely used between tool changes during setup and first-off inspection.
M02END OF PROGRAM (no rewind)Ends the program and stops all active functions (spindle, coolant, feed). Unlike M30, the program cursor does not automatically return to the beginning of the program. Rarely used on the BIGLIA B.500/SM where M30 is the standard end-of-program code.
M30END OF PROGRAM + REWINDEnd of program: stops spindle, feed axes and coolant, then automatically rewinds the program pointer to the start. Standard end-of-program code on the BIGLIA B.500/SM. Enables automatic cycle repeat in production mode.
M98SUBPROGRAM CALLCalls a subprogram stored in CNC memory: M98 Pxxxx (program number). The control executes the subprogram and returns to the next block of the main program. With address L: M98 Pxxxx Lnn repeats the subprogram nn times. Used for repetitive machining patterns.
M99END OF SUBPROGRAM / LOOPEnds a subprogram and returns to the calling program at the block following M98. Without argument: normal return. With Pxxxx: jumps to a specific sequence number. When used in a main program without a calling M98, creates an infinite program loop.
M03SPINDLE ROTATION CLOCKWISE (CW)Starts the main spindle in the clockwise direction (viewed from the spindle face / chuck side). Always programmed with an S-word (speed): e.g. G96 S180 M03 (constant surface speed) or G97 S800 M03 (fixed RPM). Must be preceded by G50 Sxxx to set maximum spindle speed. Most frequently used code in production programs.
M04SPINDLE ROTATION COUNTER-CLOCKWISE (CCW)Starts the main spindle in the counter-clockwise direction. Used on the BIGLIA B.500/SM for second-operation machining after part transfer, left-hand threading, parting-off, and specific left-hand profiling operations.
M05SPINDLE STOPStops the main spindle rotation. The stop is confirmed when spindle speed reaches zero and the completion signal is sent to the CNC. Always followed by M09 (coolant off). Programmed before every tool change and at end of program.
M13CW SPINDLE + COOLANT ON (Combined M03 + M08)Combined command activating clockwise spindle rotation (M03) and coolant (M08) simultaneously in a single block. Simplifies programming by reducing the number of NC blocks. Available depending on the machine PMC configuration.
M14CCW SPINDLE + COOLANT ON (Combined M04 + M08)Combined command activating counter-clockwise spindle rotation (M04) and coolant (M08) simultaneously. Equivalent of M13 for the reverse direction. Available depending on PMC configuration.
M19SPINDLE ORIENTATION (Oriented Stop)Positions and locks the spindle at a defined angular position (default 0°, adjustable by parameter). Requires a spindle encoder and the Spindle Orientation option. Used prior to specific tool change sequences or angular part re-registration operations.
M62SPINDLE OUTPUT ENABLEValidates the main spindle drive command output. A machine-specific function defined in the machine PMC for particular operating modes. Appears once in the analyzed programs for a special spindle control sequence.
M40GEAR CHANGE NEUTRALPlaces the gearbox in neutral (no gear engaged). On machines equipped with a mechanical multi-speed gearbox, gear range selection is triggered automatically via the programmed speed range parameters or manually by M40–M43. Must always be executed with spindle stopped (M05).
M41GEAR CHANGE LOW RANGEEngages the low speed gear range on the BIGLIA B.500/SM gearbox. Low range: maximum torque, lowest speeds suited to heavy roughing passes on hard materials (stainless steel, cast iron). Spindle must be stopped (M05) before any gear change.
M42GEAR CHANGE MIDDLE RANGEEngages the intermediate gear range. Most frequently used range for general turning operations on steel, aluminium and brass at moderate spindle speeds. Always programmed before G96 Sxxx M03 (e.g. M42 then G96 S180 M03). Spindle must be stopped before gear change.
M43GEAR CHANGE HIGH RANGEEngages the high speed gear range: high spindle speeds, reduced torque. Used for finishing passes, aluminium, brass and plastics requiring high cutting speeds. Allows the BIGLIA B.500/SM to reach its maximum spindle speed. Spindle must be stopped before engaging.
M07COOLANT ON CIRCUIT 1 (High pressure / mist)Activates the primary coolant circuit (high-pressure external coolant). The most frequently used coolant code. Typically inserted within a feed move block (e.g. G1 X-1.6 F0.1 M07) to start coolant delivery simultaneously with the cutting pass.
M08COOLANT ON CIRCUIT 2 (Flood / supplementary)Activates the secondary coolant circuit (flood coolant or supplementary nozzle), depending on the machine hydraulic configuration. Used for deep drilling and threading operations requiring sustained chip evacuation and heat dissipation.
M09ALL COOLANT OFFSimultaneously shuts off all active coolant circuits (M07, M08, and mist lubrication if active). Programmed at the end of every cutting cycle, before each tool change, and typically embedded in the tool retract block (e.g. G0 X200. Z200. M09).
M28SLIDEWAY LUBRICATION (Pulse)Commands a single lubrication pulse to the machine guideways (X and Z linear guides) and ballscrews. This function is typically managed automatically by a timed PMC routine and is rarely programmed explicitly in part programs.
M24MAIN CHUCK / COLLET OPENCommands the hydraulic opening (unclamping) of the main spindle chuck or collet. Activated at end of program for part ejection or during part reversal sequences. On the BIGLIA B.500/SM, triggered by the PMC actuating the hydraulic clamping valve.
M25MAIN CHUCK / COLLET CLOSECommands the hydraulic clamping of the main spindle chuck or collet. Clamping is confirmed by the pressure sensor signal before the cycle continues. Used after part positioning or during spindle synchronisation sequences. Program comment: (M.P. CHIUSO = Main Chuck Closed).
M64SELECT MAIN SPINDLE (Chuck control mode)Selects the main spindle as the active spindle for chuck/collet clamping and unclamping commands. On the BIGLIA B.500/SM dual-spindle configuration, this switches control between the main chuck and the sub-spindle chuck. Program comment: (SEL MAN PR = Main Spindle Selected).
M68CLAMP MAIN COLLET / CHUCKCommands clamping of the main spindle collet or chuck (pneumatic or hydraulic depending on machine specification). One of the most frequently used auxiliary codes. Paired with M69 for unclamp. Commonly used with bar feeders in automatic bar-feed production mode.
M69UNCLAMP MAIN COLLET / CHUCKCommands unclamping of the main spindle collet or chuck. Programmed at the start of the cycle (before G28 U0) to release the collet prior to bar feed advancement, or at end of program for finished part discharge.
M21TAILSTOCK ADVANCECommands the tailstock to advance toward the workpiece. The tailstock moves hydraulically to an adjustable mechanical stop. Travel stops on force detection or at the end-of-travel limit switch. Used to support long workpieces in between-centres turning operations.
M22TAILSTOCK RETRACTCommands the tailstock to retract to its rest position, releasing the workpiece from the live/dead centre. Retract position is confirmed by a home position sensor before the program continues.
M46TAILSTOCK BODY UNLOCK + QUILL ADVANCEUnlocks the tailstock body on the guideways and simultaneously advances the quill (tailstock barrel). Allows the tailstock to be repositioned freely along the bed. Specific to machines with CNC-programmable tailstock positioning.
M47TAILSTOCK BODY CLAMP + QUILL RETRACTClamps the tailstock body in position on the guideways and simultaneously retracts the quill. Complement of M46. Ensures the tailstock is rigidly locked before between-centres machining or collet clamping sequences.
M53TAILSTOCK BRAKE RELEASE (Free travel)Releases the hydraulic tailstock clamp brake to allow free positioning travel. Program comment: (CONTR. APERTA = Tailstock Open). Defined in the machine PMC. Always followed by a travel move and then M54 (clamp) or M78 (rapid advance).
M54TAILSTOCK HYDRAULIC CLAMPHydraulically clamps the tailstock in its current position. Program comment: (CONTR. CHIUSA = Tailstock Clamped). Confirms secure tailstock contact with the workpiece before machining. Clamping pressure is programmable in the machine PMC parameters.
M78TAILSTOCK RAPID ADVANCE (Approach)Commands the tailstock rapid approach toward the workpiece. Triggers the hydraulic or servo-driven advance in fast approach mode. Always followed by a controlled G01 move for precision positioning and then M79 (centre locking under pressure).
M79TAILSTOCK CENTRE LOCK (Controlled thrust)Locks the tailstock with a controlled hydraulic thrust force against the workpiece centre. Thrust force is an adjustable parameter. Used for between-centres turning operations or during workpiece transfer to the sub-spindle.
M58SUB-SPINDLE ENABLEEnables the sub-spindle (secondary spindle at the tailstock end). On the BIGLIA B.500/SM dual-spindle configuration, activates the secondary spindle drive for second-operation machining without part removal. Always paired with M03 or M04 to set the direction of rotation.
M59SUB-SPINDLE DISABLEStops and disables the sub-spindle. Programmed at the end of second-operation machining sequences, before tool retract and program end. Always used in symmetry with M58 in dual-operation programs.
M63SECONDARY SPINDLE STOP (Combined)Stops the secondary spindle (sub-spindle). Used in combined sequences (M05 M63) to simultaneously stop both the main spindle and the sub-spindle after workpiece transfer. Defined in the machine PMC.
M65SUB-SPINDLE ACTIVATE (Controtesta mode)Activates the motorised sub-spindle (controtesta). Program comment: (CONTROTESTA). After M65, the CNC selects the tool offsets and machining parameters associated with the sub-spindle for second-operation turning. Paired with M64 for spindle selection.
M85SUB-SPINDLE PART EJECTOR ADVANCECommands the advance of the part ejector/pusher on the sub-spindle. After second-operation machining is complete, ejects the finished part onto the conveyor or parts catcher. Activated via the machine PMC. Not active in manual production mode without a bar loader.
M86SUB-SPINDLE PART EJECTOR RETRACTRetracts the sub-spindle part ejector to its rest position after part ejection. Complement of M85. Retract position is confirmed by the end-of-travel sensor before the next cycle begins.
M61MAIN / SUB-SPINDLE SYNCHRONISATIONInitiates angular synchronisation between the main spindle and the sub-spindle for shock-free workpiece transfer. Synchronisation is managed by the machine PMC. Must always be executed before M53 (tailstock travel) and M54 (tailstock clamp) in the transfer sequence.
M115SPINDLE / B-AXIS COUPLING (Special angular sync)BIGLIA-specific function: activates synchronised coupling between the main spindle and the B-axis (or C-axis depending on machine configuration). Program comment: (C.SP.ASSE B). Used in transfer sequences requiring precise angular alignment between the two spindles.
M10C-AXIS ENABLE (Spindle indexing mode)Enables the C-axis: the main spindle switches from continuous rotation mode to a servo-controlled positioning axis. Required before any live-tool milling or off-centre drilling operation. Always followed by G28 C0 (C-axis reference return) before the first angular positioning move.
M11C-AXIS DISABLEDisables the C-axis and releases the spindle back to free rotation mode for turning operations. Programmed at the end of live-tool sequences, before returning to standard turning with M03/M04.
M70RADIAL LIVE TOOL ENABLEEnables the radial live-tool head (tooling operating perpendicular to the Z-axis). Activates the radial powered tool station for radial drilling and milling operations (cross holes, flats, hexagons). Must be preceded by M10 (C-axis enable). Defined in the machine PMC.
M71RADIAL LIVE TOOL DISABLEDisables the radial live-tool head and returns the turret to standard turning mode. Programmed after radial live-tool operations, before M11 (C-axis disable) and return to turning.
M73LIVE TOOL ROTATION CLOCKWISE (CW)Starts the live tool spindle (milling cutter, drill) in the clockwise direction. Equivalent of M03 for the turret live-tool motor. Used in all axial and radial live-tool cycles (e.g. G97 S2000 M73 for milling at 2000 RPM). Defined in the machine PMC.
M74LIVE TOOL ROTATION COUNTER-CLOCKWISE (CCW)Starts the live tool spindle in the counter-clockwise direction. Used for left-hand tapping or climb milling with specific tools. Complement of M73. Defined in the machine PMC.
M75LIVE TOOL STOPStops the live tool spindle. Equivalent of M05 for the turret live-tool motor. Programmed after live-tool operations before the rapid retract move (e.g. G0 X200. Z50. M75). Defined in the machine PMC.
M29RIGID TAPPING ENABLEActivates the rigid tapping mode: the spindle rotation is electronically synchronised with the Z-axis feed through the G84 tapping cycle, eliminating the need for a floating tap holder. Requires the Rigid Tapping option and a spindle encoder. Syntax: M29 S[speed] then G84 Z_ R_ F[pitch].
M35SYNCHRONISED TAPPING ENABLE (Machine PMC)Activates the synchronised tapping mode via the machine PMC. Validates internal spindle speed control for the tapping cycle. Present in the analyzed programs. This is a machine-specific PMC function, not a standard CNC code.
M48FEEDRATE / SPINDLE OVERRIDE ENABLERe-enables the manual feedrate and spindle speed override controls from the operator panel. Used at the end of threading or tapping cycles (where overrides were locked by M49) to restore operator speed control.
M49FEEDRATE / SPINDLE OVERRIDE INHIBITDisables manual feedrate and spindle override adjustments from the operator panel. Mandatory during threading cycles (G32, G76, G92) and rigid tapping to maintain the precise speed-to-feed ratio. Cancelled by M48 at the end of the cycle.
M38STEADY REST CLAMPCommands closure of the fixed steady rest (steady rest fingers) onto the workpiece. Available on configurations fitted with a hydraulic steady rest for supporting long workpieces during turning. The steady rest must be pre-set to the workpiece diameter before clamping.
M39STEADY REST UNCLAMPCommands opening of the fixed steady rest, releasing the workpiece support. Unclamp is confirmed by a position sensor before any workpiece movement. Complement of M38.
M50BAR FEEDER ADVANCE (Bar loader)Commands the bar feeder to advance a new bar into the chuck/collet after part cut-off and ejection. Triggers the bar feed advance cycle. Not active in manual production mode without a bar loader connected to the machine.
M52FRONT GUARD DOOR OPENCommands opening of the front protection door (splash guard / electric sliding door). Activates the door actuator (pneumatic cylinder or gearmotor). Used in automatic load/unload sequences or after M00 stops for part inspection.
M06AUTOMATIC TOOL CHANGE (Turret index)Commands automatic indexing of the turret to the tool station designated by the T-word. On the BIGLIA B.500/SM, tool changes are typically integrated into the T-command (e.g. T0303 = tool station 3, offset 3). M06 may or may not be required depending on the machine PMC configuration.
M17TURRET INDEX FORWARD DIRECTIONForces turret indexing in the forward (positive) direction to reach the requested tool station. On machines with bi-directional turrets, overrides the automatic shortest-path selection. Normally managed automatically by the T-command.
M18TURRET INDEX REVERSE DIRECTIONForces turret indexing in the reverse direction to reach the requested tool station. Allows the shortest path to be forced in reverse when needed. Normally managed automatically by the T-command shortest-path algorithm.
M80CYCLE END REQUEST PART UNLOAD (Bar loader interface)End-of-cycle signal sent to the automatic bar loader or robot: requests finished part ejection and loading of the next bar/blank. Interface between the CNC and the bar feeder or loading robot. Not active in manual production mode.
M81PART RELEASED (Bar loader interface)Confirms to the bar loader or robot that the finished part has been released (chuck open, part accessible for pick-up). Synchronises the CNC with the loader for automatic part exchange in production cycle.
M82REQUEST PART LOAD (Bar loader interface)Signal to the bar loader to insert a new raw part or bar stock into the chuck. The CNC waits for the M83 confirmation signal (part clamped) before resuming the machining cycle.
M83PART CLAMPED CONFIRMED (Bar loader interface)Confirmation from the bar loader that the new workpiece is correctly clamped in the chuck. Reply signal to M82. The part program resumes machining after receipt of this confirmation signal.
M90PARTS COUNTER INCREMENT + PARTIAL RESETIncrements the finished-parts counter on the operator panel and/or performs a partial reset of internal machine states. Programmed at the end of certain programs before M30. On some PMC configurations, also controls the chip conveyor or resets axis-specific states.

Technical Notes

  • Dual-Spindle Architecture : The BIGLIA B.500/SM is a CNC dual-spindle turning center with a main spindle and a motorised sub-spindle . The main spindle handles first-operation machining; the sub-spindle enables complete second-operation machining without unloading the part. Part transfer between spindles is achieved through spindle angular synchronisation (M61/M115) and tailstock clamping sequences.
  • Machine PMC Codes : All M-codes above M20 (except M28, M29, M30, M48, M49, M98, M99) are machine auxiliary functions defined by BIGLIA in the PLC Ladder program (PMC). Their exact behaviour depends on the PMC software version and the options fitted to the machine. Always refer to the BIGLIA B.500/SM electrical manual and the PMC program listing for authoritative code definitions.
  • Spindle Gear Ranges : The BIGLIA B.500/SM is fitted with a mechanical multi-speed gearbox driven by pneumatic actuators. Gear range selection (M41/M42/M43) must always be executed with the spindle stopped (M05). The spindle speed parameters for each range are defined in the machine CNC parameters. On 2-range configurations, M42 may represent the high range.
  • C-Axis / Live Tooling : The C-axis and live-tool functions (M10/M11, M70–M75) require the C-axis option to be installed and configured on the CNC. Before any live-tool operation, the C-axis must be enabled (M10), a C-axis reference return performed (G28 C0), and the appropriate live-tool station enabled (M70 for radial, or direct for axial). Always disable the live-tool motor (M75) and C-axis (M11) before returning to turning mode.
  • Bar Feeder Interface:M50, M80–M83 are active only when the machine is connected to an automatic bar feeder or loading robot. In manual production mode, these codes are either ignored or suppressed by a PMC parameter. Including them in a program intended for manual operation may cause the CNC to wait indefinitely for a confirmation signal.

DAEWOO PUMA 450

M-CODEDESCRIPTION
M00PROGRAM STOP
M01OPTIONAL STOP
M02PROGRAM END
M03MAIN-SPINDLE FORWARD
M04MAIN-SPINDLE REVERSE
M05MAIN-SPINDLE STOP
M07HIGH PRESSURE COOLANT ON
M08COOLANT ON
M09COOLANT OFF
M10PARTS CATCHER ADVANCE
M11PARTS CATCHER RETRACT
M13TURRET AIR BLOW
M14MAIN-SPINDLE AIR BLOW
M15AIR BLOW OFF
M17MACHINE LOCK ACT
M18MACHINE LOCK CANCEL
M19MAIN-SPINDLE ORIENTAION
M24CHIP CONVEYOR RUN
M25CHIP CONVEYOR STOP
M30PROGRAM END & REWIND
M31INTERLOCK BY-PASS(SPDL &T/S)
M32INTERLOCK BY-PASS(SPDL &S/R)
M33REV.-TOOL-SPINDLE FORWARD
M34REV.-TOOL-SPINDLE REVERSE
M35REV.-TOOL-SPINDLE STOP
M39STEADY REST 1 UNCLAMP
M40GEAR CHANGE NETURAL
M41GEAR CHANGE LOW
M42GEAR CHANGE MIDDLE
M43GEAR CHANGE HIGH
M46PTS BODY UNCL & TRACT-BAR ADV.
M47PTS BODY CL & TRACT-BAR RET.
M50BAR FEEDER COMMAND 1
M51BAR FEEDER COMMAND 2
M52SPLASH GUARD DOOR OPEN
M53SPLASH GUARD DOOR CLOSE
M54PARTS COUNT
M58STEADY REST 2 CLAMP
M59STEADY REST 2 UNCLAMP
M61SWITCHING LOW SPEED (N.J)
M62SWITCHING HIGH SPEED (N.J)
M63MAIN-SPDL CW & COOLANT ON
M64MAIN-SPDL CCW & COOLANT OFF
M65MAIN-SPDL & COOLANT OFF
M66DUAL CHUCKING LOW CLAMP
M67DUAL CHUCK HIGH CLAMP
M68MAIN-CHUCK CLAMP
M69MAIN-CHUCK UNCLAMP
M70DUAL TAILSTOCK LOW ADVANCE
M74ERROR DETECT ON
M75ERR0R DETECT OFF
M76CLAMFERING ON
M77CLAMFERING OFF
M78TAILSTOCK QUILL ADVANCE
M79TAILSTOCK QUILL RETRACT
M80Q-SETTER SWING ARM DOWN
M81Q-SETTER SWING ARM UP
M84TURRET CW ROTATION
M85TURRET CCW ROTATION
M86TORQUE SKIP ACT
M87TORQUE SKIP CANCEL
M88SPINDLE LOW CLAMP
M89SPINDLE HIGH CLAMP
M90SPINDLE UNCLAMP
M91EXTERNAL M91 COMMAND
M92EXTERNAL M92 COMMAND
M93EXTERNAL M93 COMMAND
M94EXTERNAL M94 COMMAND
M98SUB-PROGRAM CALL
M99END OF SUB-PROGRAM
M103SUB-SPINDLE FORWARD
M104SUB-SPINDLE REVERSE
M105SUB-SPINDLE STOP
M110PARTS CATCHER ADVANCE(SUB)
M111PARTS CATCHER RETRACT(SUB)
M114SUB-SPINDLE AIR BLOW
M119SUB-SPINDLE ORIENTATION
M131INTERLOCK BY-PASS (SUB-SPDL)
M163SUB-SPDL CW & COOLANT ON
M164SUB-SPDL CCW & COOLANT OFF
M165SUB-SPDL & COOLANT STOP
M168SUB-CHUCK CLAMP
M169SUB-CHUCK UNCLAMP
M203FORWARD SYNCHRONOUS COM.
M204REVERSE SYNCHRONOUS COM.
M205SYNCHRONOUS STOP
M206SPINDLE ROTATION RELEASE

Machining Centers

AWEA

AF 650
TYPE:C-Type Series
CONTROLLER:FANUC 0iMD / 18iMB / 31iB

M codeFunction
M00Program Stop
M01Optional Stop
M02End of Program
M03Spindle Forward
M04Spindle Reverse
M05Spindle Stop
M06Automatic Tool Change
M07Air Blow ON
M08Coolant ON
M09All Coolant OFF (Cancel M07, M08, M28, M51)
M104th Axis Unclamp
M114th Axis Clamp
M13Spindle Forward – Flood Coolant ON
M14Spindle Reverse – Flood Coolant ON
M15ATC Door Open
M16ATC Door Close
M19Spindle Orientation
M21Tool Pocket Down & Magazine Move in
M23Spindle Unclamp
M25Spindle clamp
M27Arm Up & Magazine Move Out
M28Flood Coolant ON (OPTION)
M29Rigid Tapping Mode ON
M30End of Program
M39Retraction For Rigid Tapping
M455th Axis Unclamp
M465th Axis Clamp
M48Override Cancel On
M49Override Cancel Off
M51Coolant Through Spindle ON (OPTION)
M56ATLM & Air Clean ON
M57ATLM    & Air Clean OFF
M59TS27R Start
M60OMP60 Start
M61Chip Wash Pump ON
M62Chip Conveyor ON
M63Chip Screw ON
M64Chip Remove System OFF
M65APC Clean ON
M66APC Clean OFF
M70Mirror Cancel
M71X Axis Mirror Effective
M72Y Axis Mirror Effective
M73Z Axis Mirror Effective
M744th Axis Mirror Effective
M75Counter OFF
M76Counter ON
M78APC Ready Check Finish
M79RECTIFICATION TOOL
M80APC Ready Check ON
M81Smoke Exhaust ON
M81Smoke Exhaust OFF
M85Oil Mist ON
M86Oil Mist OFF
M87Air Extraction ON
M88Air Extraction OFF
M98Call Sub-program
M99Return to Main Program

LEADWELL

Machine : LV-300SL
Control : OMF | Option : 01/LO

CLASSIFICATION B = Basic / O = Option

M FUNCTIONDESCRIPTIONCL.
M00PROGRAM STOPOPERATION CAN BE RESTART BY START BUTTONB
M01OPTION STOPON/OFF OF M01 CONTROLLED BY SWITCH ON THE PANELB
M02PROGRAM ENDNC UNIT IS RESET & STOPPING ALL OPERATIONS OF MACHINEB
M03SPINDLE FORWARDB
M04SPINDLE REVERSEB
M05SPINDLE STOPB
M06AUTOMATIC TOOL CHANGEO
M07COOLANT THROUGH SPINDLEB
M08CUTTING OIL SUPPLYSPINDLE MUST BE RUN ON AUTO MODEB
M09CUTTING OIL STOP & OIL MIST OFFB
M13SPINDLE CW & COOLANT ONB
M14SPINDLE CCW & COOLANT ONB
M19SPINDLE ORIENTATIONB
M23MAGAZINE POCKET UPB
M24MAGAZINE POCKET DOWNB
M25TOOL CLAMPB
M26TOOL UNCLAMPB
M29RIGID TAPPINGO
M30PROGRAM REWINDB
M31PALLET UPONLY USED IN MDI MODEB
M32PALLET DOWNONLY USED IN MDI MODEB
M33PALLET CWONLY USED IN MDI MODEB
M34PALLET CCWONLY USED IN MDI MODEB
M404 AXIS CLAMPFOR 4 MACHINE WITH 4TH AXIS SPARE FUNCTION FOR 3 AXISO
M414 AXIS UNCLAMPSAME AS ABOVEO
M45CHIP CONVEYOR ONB
M46CHIP CONVEYOR OFFB
M59AUTO PALLET CHANGEB
M61MIRROR IMAGE X OFFB
M62MIRROR IMAGE Y OFFB
M63MIRROR IMAGE 4 OFFB
M65MIRROR IMAGE 4 OFFB
M70MIRROR IMAGE X ONB
M71MIRROR IMAGE Y ONB
M74MIRROR IMAGE 4 ONB
M80ON/OFF MOMENTARYO
M81SPARE FUNCTIONM83:ON M84:OFFO
M82SPARE FUNCTIONON/OFF MOMENTARYO
M83SPARE FUNCTIONM84:ON M83:OFFO
M84SPARE FUNCTIONON-FIN-OFF PULSE OUTPUT TYPEO
M85SPARE FUNCTIONON-FIN-OFF PULSE OUTPUT TYPEO
M86SPARE FUNCTIONON-FIN-OFF PULSE OUTPUT TYPEO
M87SPARE FUNCTIONON-FIN-OFF PULSE OUTPUT TYPEO
M88SPARE FUNCTIONON-FIN-OFF PULSE OUTPUT TYPEO
M89SPARE FUNCTIONON-FIN-OFF PULSE OUTPUT TYPEO
M95PART COUNTERB
M98CALL SUB-PROGRAMB
M99END SUB-PROGRAMB

Daewoo

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
M144th axls unclamp
M155th axls clamp
M165th axls unclamp
M17AUTO DOOR CLOSE
M18AUTO DOOR OPEN
M19Spindle orientation
M20Open tool magazine door
M21Close tool magazine door
M30Program end and return to start
M37CHIP CONVEYOR CW
M38CHIP CONVEYOR STOP
M79Tool reset (suitable for arm type tool store)
M97PARTS COUNTED
M98Subprogram call
M99Subprogram return
M100–M199Customizable codes (user-defined)
M74TOUCH PROBE START
M75TOUCH PROBE STOP STATE
M76AUX. CLAMP 1 (FIXTURE DEVICE CLAMP 1)
M77AUX. UNCLAMP 1 (FIXTURE DEVICE UNCLAMP 1)
M78PALLET CLAMP
M79PALLET UNCLAMP
M80MIRROR IMAGE CANCEL
M81MIRROR IMAGE X AXIS
M82MIRROR IMAGE Y AXIS
M83MIRROR IMAGE 4th AXIS
M84CUTTING FEED POSSIBLE DURING SPINDLE STOP
M85CUTTING FEED IMPOSSIBLE DURING SPINDLE STOP
M86AUX. CLAMP 2 (FIXTURE DEVICE CLAMP 2)
M87AUX. UNCLAMP 2 (FIXTURE DEVICE UNCLAMP 2)
M88AUX. CLAMP 3 (FIXTURE DEVICE CLAMP 3)
M89AUX. UNCLAMP 3 (FIXTURE DEVICE UNCLAMP 3)
M90
M91EXTERNAL M CODE 1
M92EXTERNAL M CODE 2
M93EXTERNAL M CODE 3
M94EXTERNAL M CODE 4
M95EXTERNAL M CODE 5
M96MACRO INTERRUPT ENABLE
M97MACRO INTERRUPT CANCEL
M98SUBPROGRAM CALL
M99SUBPROGRAM END
M843RIGID TAPPING MODE (RIGHT-HAND THREAD)
M844RIGID TAPPING MODE (LEFT-HAND THREAD)
M845RIGID TAPPING MODE CANCEL

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.

Leave a Comment

Scroll to Top