Mazak CNC Machine Code Reference

Mazak Corporation is the undisputed world leader in CNC machine tools with the largest market share in the world with revenue of 5.28 billion dollars and more than a hundred years of manufacturing innovation. To the manufacturing professionals and CNC programmers, it is important to learn the complete machine code system of Mazak in order to optimize productivity and accuracy in the current machining processes.

Mazak’s revolutionary approach to CNC programming

The programming system at Mazak is a more advanced development of the old G-code systems. In 1981, the MAZATROL conversational programming system was the first conversational CNC programming interface in the world, enabling operators to program machines in normal language instead of complicated code structures. This two-mode system offers the ease of use of conversational programming and the accuracy of conventional EIA/ISO G-code, thus Mazak systems can be used by both skilled programmers and those who are new to CNC machining.

The new MAZATROL SmoothAi controllers in the company incorporate artificial intelligence that develops through the experience of programming and automatically optimizes machining processes and cutting conditions. This is a major improvement on the conventional programming techniques where AI is used to generate toolpaths, optimize processes, and predictive maintenance.

Complete Mazak machine code reference tables

Mazak G-codes for M-series machining centers

G-Code Description Application
G00 Rapid positioning Fast non-cutting moves
G01 Linear interpolation Straight cutting moves
G02 Circular interpolation CW Clockwise arcs and circles
G03 Circular interpolation CCW Counterclockwise arcs and circles
G02.1 Spiral interpolation CW Clockwise helical cutting
G03.1 Spiral interpolation CCW Counterclockwise helical cutting
G04 Dwell/pause Temporary stop with timer
G05 High-speed machining mode Optimized acceleration profiles
G06.1 Fine spline interpolation Smooth surface finishing
G06.2 NURBS interpolation Complex surface finishing
G07.1 Cylindrical interpolation Specialized cylinder operations
G09 Exact stop check Precise positioning verification
G10 Programmable data input Work offset and tool setting
G11 Programmable data input cancel Cancel G10 mode
G17 XY plane selection Circular interpolation in XY
G18 ZX plane selection Circular interpolation in ZX
G19 YZ plane selection Circular interpolation in YZ
G20 Inch programming Imperial units
G21 Metric programming Millimeter units
G28 Return to reference point Machine zero return
G29 Return from reference point Move from machine zero
G40 Tool radius compensation cancel Cancel cutter compensation
G41 Tool radius compensation left Left-side cutter compensation
G42 Tool radius compensation right Right-side cutter compensation
G43 Tool length compensation positive Positive tool length offset
G44 Tool length compensation negative Negative tool length offset
G49 Tool length compensation cancel Cancel tool length offset
G53 Machine coordinate system Absolute machine positioning
G53.5 MAZATROL coordinate system Program-resident work offsets
G54-G59 Work coordinate systems Six standard work offsets
G80 Fixed cycle cancel Cancel all fixed cycles
G81 Drilling cycle Standard hole drilling
G82 Drilling cycle with dwell Drilling with pause
G83 Peck drilling cycle Deep hole drilling
G84 Tapping cycle Threading operations
G85 Boring cycle Precise hole boring
G86 Boring cycle with stop Boring with spindle stop
G87 Back boring cycle Reverse boring operations
G88 Boring cycle with manual Manual boring operations
G89 Boring cycle with dwell Boring with pause
G90 Absolute programming Absolute coordinate mode
G91 Incremental programming Incremental coordinate mode
G92 Coordinate system setting Local coordinate establishment
G94 Feed per minute mm/min or in/min feed rate
G95 Feed per revolution mm/rev or in/rev feed rate
G96 Constant surface speed CSS for turning operations
G97 Constant spindle speed RPM mode
G98 Return to initial point Fixed cycle return level
G99 Return to R point Fixed cycle intermediate return
G130 Tornado cycle High-speed roughing cycle
G136 Measurement cycle Workpiece measurement
G137 Tool measurement Tool setting and verification

Mazak G-codes for T-series turning centers

G-Code Description Application
G00 Rapid positioning Fast non-cutting moves
G01 Linear interpolation Straight cutting moves
G02 Circular interpolation CW Clockwise arcs
G03 Circular interpolation CCW Counterclockwise arcs
G04 Dwell Pause with timer
G20 Inch programming Imperial units
G21 Metric programming Millimeter units
G28 Reference point return Machine zero return
G32 Thread cutting Straight and taper threads
G40 Tool nose radius compensation cancel Cancel TNRC
G41 Tool nose radius compensation left Left TNRC
G42 Tool nose radius compensation right Right TNRC
G50 Coordinate system/max speed Work offset and speed limit
G70 Finishing cycle Precision finishing operations
G71 Longitudinal roughing Parallel roughing cycle
G72 Transverse roughing Face roughing cycle
G73 Contour parallel roughing Pattern roughing cycle
G74 End face peck drilling Axial drilling operations
G75 Grooving cycle Longitudinal grooving
G76 Threading cycle Complete threading operations
G90 Longitudinal turning cycle Simple turning operations
G92 Threading cycle Basic threading
G94 Transverse turning cycle Face turning operations
G96 Constant surface speed CSS mode
G97 Constant spindle speed RPM mode
G122 Polar coordinate programming Complex coordinate systems
G123 Polar coordinate cancel Exit polar mode

Complete Mazak M-code reference

M-Code Description Machine Type
M00 Program stop All machines
M01 Optional stop All machines
M02 Program end All machines
M03 Spindle start CW All machines
M04 Spindle start CCW All machines
M05 Spindle stop All machines
M06 Tool change Machining centers
M07 Mist coolant on All machines
M08 Flood coolant on All machines
M09 Coolant off All machines
M19 Spindle orientation All machines
M20 Robot arm advance With automation
M21 Robot arm retract With automation
M22 Robot clamp With automation
M23 Robot unclamp With automation
M30 Program end and reset All machines
M33 Chuck pressure high Turning centers
M34 Chuck pressure low Turning centers
M41 Low gear range All machines
M42 High gear range All machines
M72 Inside chuck clamp Turning centers
M73 Outside chuck clamp Turning centers
M81 Workpiece measurement With probing
M82 Tool measurement X With probing
M83 Tool measurement Z With probing
M84 Tool measurement XZ With probing
M100 Measurement output With probing
M110 Measurement comparison With probing
M120 Measurement data save With probing
M153 Milling spindle through coolant INTEGREX series
M154 Mill spindle through coolant off INTEGREX series
M155 Chuck coolant on Turning centers
M156 Chuck coolant off Turning centers
M169 High pressure coolant With HPC system
M200 Turning spindle CW INTEGREX series
M201 Turning spindle CCW INTEGREX series
M202 Turning spindle stop INTEGREX series
M203 Turning spindle orientation INTEGREX series
M204 C-axis unclamp INTEGREX series
M205 C-axis clamp INTEGREX series
M300 Second spindle CW Twin spindle machines
M301 Second spindle CCW Twin spindle machines
M302 Second spindle stop Twin spindle machines
M303 Second spindle orientation Twin spindle machines
M310 Spindle synchronization on Twin spindle machines
M311 Spindle synchronization off Twin spindle machines
M319 Second spindle position Twin spindle machines
M511 Synchronized spindle rotation INTEGREX series
M512 Synchronized spindle stop INTEGREX series
M513 Synchronized spindle cancel INTEGREX series

MAZATROL-specific programming codes

Function Code/Command Description
Unit Selection IN/MM Imperial or metric units
Tool Call T## Tool selection and offset
Work Offset #1-#6 MAZATROL work coordinate systems
Face Mill FACE Conversational face milling
Profile Mill PROFILE Conversational profile milling
Pocket Mill POCKET Conversational pocket milling
Drilling DRILL Conversational drilling cycle
Boring BORE Conversational boring cycle
Tapping TAP Conversational tapping cycle
Turn/Face TURN/FACE Turning operations
Thread Cut THREAD Threading operations
Groove GROOVE Grooving operations
Part Off PART Parting operations
Polygon Turn POLYGON Multi-sided turning

Advanced Mazak controller features

Feature Function Benefit
Variable Feed Control (VFC) Real-time feed optimization Improved surface finish
Tool Path Store (TPS) Program interruption/continuation Safe program restart
Smooth Corner Control Corner smoothing algorithm Reduced cycle time
Look-Ahead Processing Unlimited block preview Optimized acceleration
MAZATROL Preview Graphical program verification Error prevention
Auto Power Save Automatic power management Energy efficiency
Collision Avoidance Real-time interference checking Machine protection
Tool Life Management Automatic tool monitoring Predictive maintenance

This extensive code reference shows how Mazak has developed a highly advanced method of CNC programming, with compatibility to ISO standards, but with proprietary extensions that provide high performance and productivity in contemporary manufacturing facilities.

Programming best practices and real-world applications

To program Mazak successfully, one must know conversational and G-code programming. MAZATROL conversational programming is well suited to job shop applications that require fast changeover of setups and a variety of part requirements that require a flexible programming method. Automatic calculation of intersection coordinates and toolpath optimization capabilities of the system make it a perfect choice in case the operator has to concentrate on machining rather than on the complexity of the programming.
G-code programming is necessary when geometries are complex, when toolpaths are generated by CAM, and when it is necessary to have fine control over the toolpath. The dual-mode programming feature enables the programmer to switch between conversational and G-code programming in the same program and offers the greatest flexibility to meet the varying machining needs.
Such advanced functions as the Variable Feed Control (VFC) allow optimizing feeds and speeds in real-time during the cutting process, whereas the Tool Path Store (TPS) feature makes it possible to pause the program and resume it safely. These characteristics in conjunction with the Mazak Smooth Corner Control and unlimited look-ahead processing provide excellent surface finishes and shorter cycles.

Comparison with standard implementations

The strategy of Mazak is to balance the requirements of ISO 6983 and proprietary improvements. Mazak brings a lot of value to the standard G-code functionality with conversational programming, advanced work offset management, and integrated manufacturing capabilities, all of which remain compatible with standard G-code functionality. G53.5 MAZATROL coordinate system avoids work offset conflicts because it keeps program-resident coordinates, which is a frequent cause of machining errors.

The main departure of the standard implementations is machine-specific M-codes, which are highly customized to the capabilities of Mazak hardware. The extent of Mazak integrated approach to manufacturing automation is evidenced by the robot integration codes (M20-M29), multi-spindle coordination functions and complex measurement cycles.
Compatibility with CAM software is also good, with the majority of the major systems offering Mazak-specific post-processors. Mazatrol programs are however not directly transferable to other CNC systems and long term programming strategy and operator training needs must be considered.

Essential considerations for implementation

The most important benefit to manufacturing professionals who are considering Mazak systems is the flexibility in programming that can be used to suit varying levels of skills and application needs. The conversational programming interface cuts down the time needed to train new operators, but still has full G-code capability to support complex applications.

The quickest route to productivity is through investment in official Mazak training programs, with more than 100 courses offered in the National Technology Center and online MODL platform.
The programming strategy must take advantage of the conversational and G-code capabilities instead of imposing the traditional methods on the MAZATROL system. To succeed, one should realize that the philosophy of Mazak is to describe part geometry instead of defining tool paths, so the system can optimize cutting processes automatically.

The total combination of measurement, automation, and process optimization in Mazak systems offers high competitive advantages in the contemporary manufacturing world. The advanced programming features of the system usually allow companies applying Mazak technology to attain better quality consistency, shorter setup times, and greater flexibility in production.
The fact that Mazak is the world leader in CNC machine tools and has a revolutionary approach to programming and constant technological development makes the knowledge of these machine codes a necessity to manufacturing professionals. The competitive advantage of the company in the contemporary precision manufacturing is based on the dual-mode programming system, advanced controller functions, and extensive automation possibilities.

Largest Used CNC Inventory

Want to view all our used CNC machines? Browse our full inventory of machines—it's updated daily!
View Now