Probing on Mazak (MAZATROL & EIA)
A Mazak with a spindle touch probe has two probing worlds, because the control runs two programming languages. On the MAZATROL side, probing is a built-in part of the conversational workflow — you measure the workpiece zero and the tools through guided screens and measurement units, and the control writes the results into the program’s coordinate and tool data for you. On the EIA/ISO side, probing is skip programming: G31 moves, positions latched into #-variables, and your own (or Renishaw’s) macro math. Most shops use both without thinking about it — MAZATROL measurement at setup, EIA macros when a running G-code program needs to gauge itself. This page covers both, and when to reach for each.
| MAZATROL side | EIA side | |
|---|---|---|
| What it is | Measurement built into setup screens and program units (WPC measurement, MMS unit, tool eye) | G31 skip moves + #-variable math, hand-written or as a Renishaw macro package |
| Where results go | Written by the control into WPC / TOOL DATA | Wherever your macro writes them: work offsets, tool data, common variables, alarms |
| Typical use | Setup, first-article pickup, tool setting | In-process gauging, adaptive loops, SPC capture |
| Programming required | None — guided screens | Macro programming (or a package’s G65 calls) |
MAZATROL-Side: WPC and Tool Measurement
Every MAZATROL program carries its workpiece zero in the basic coordinates (WPC) unit — the zero point expressed in machine coordinates. The conversational workflow’s probing exists to fill that unit in without arithmetic: with the probe in the spindle you touch a face, an edge pair, or a bore through the control’s coordinate-measurement screens, and the control computes the zero point and writes it straight into the WPC data. For automated, in-program measurement, the MMS unit does the same job under program control — it is a program unit whose entire purpose is automatic measurement of the basic coordinate system with the spindle probe, so a palletized or repeat job can re-find its own zero every cycle without an operator at the screen.
Tool measurement is the same idea on the tool side. Machines equipped with a touch-setter (a “tool eye” probe on the table) or a laser measure tool length — and diameter, where the hardware supports it — by driving the tool against the sensor or through the beam under a guided routine, and the result lands in TOOL DATA (LENG COMP., actual diameter). Because MAZATROL’s auto-developed toolpaths and interference checks read TOOL DATA directly, measured tools feed straight into everything the conversational side generates.
This is most shops’ daily probing on a Mazak, and the reason it doesn’t feel like “probing”: nothing is programmed. It is part of setup — a few screens between clamping the part and pressing cycle start — and the results go directly into the data the program runs from. If your only probing need is “find the part and set the tools,” you may never write a skip move.
| Measurement | How | Result lands in |
|---|---|---|
| Workpiece zero — face / edge / corner | Coordinate-measurement screens: touch the surfaces, control does the geometry | WPC unit (basic coordinates) of the program |
| Workpiece zero — bore / boss center | Multi-touch center measurement through the same screens | WPC unit |
| Workpiece zero, unattended / per-cycle | MMS unit in the program — automatic measurement of the basic coordinate system with the spindle probe | WPC data, refreshed each run |
| Tool length (and diameter where equipped) | Tool eye touch-setter or laser routine drives the tool to the sensor | TOOL DATA (LENG COMP., actual diameter) |
One caution that carries over from every other probing platform: the guided screens are only as accurate as the probe’s calibration. A stylus knocked out of true measures a WPC that is consistently, invisibly wrong — see the Gotchas below.
EIA-Side: G31 Skip and the #-Variables
The EIA/ISO side gives you the raw mechanism. G31 is a feed move that ends early when the skip input fires — the probe touches, motion stops, the rest of the commanded distance is discarded, and the control latches the position of every axis at the trigger instant into the skip-signal variables #5061–#5076 (axis 1–16 = last digit, so #5061 = X, #5062 = Y, #5063 = Z), readable any time after. Multi-step skip (G31.1/G31.2/G31.3) selects alternate skip inputs on machines with more than one sensor. The variables a probing routine lives on, all documented in the EIA/ISO article:
| Variable(s) | Role in probing |
|---|---|
#5061–#5076 | Skip-signal position per axis, latched at the G31 trigger — the raw measurement data |
#5041–#5056 | Present workpiece coordinates (read after motion stops) — where the probe is now |
#5021–#5036 | Present machine coordinates — for results that must be machine-referenced |
#3020 → #40001+n / #41001+n | Tool-data index of the spindle tool → tool length / radius data by index — how a probing macro updates tool data (no fixed Fanuc-style #2001 block exists) |
#5800, #5801–#5878 | Selected workpiece-setup data set (1–7, read-only) and its correction data (see G54.4) |
#100–#199 / #500–#999 | Common variables for passing results between programs — volatile / power-off retained |
#3000 / #3006 | Force an alarm / a message-and-stop — the tolerance-failure exits |
Everything a probing routine does is built from the G31 primitive plus user-macro arithmetic, in a few recurring patterns:
| Building block | Mechanism |
|---|---|
| Double touch | First G31 at a fast find feed to locate the surface, a short back-off move, then a second G31 at a slow gauging feed. The slow touch is the measurement; the fast one just finds where to slow down. Every serious package measures this way. |
| Protected positioning | Rapid moves near the part are replaced by skip-monitored moves: if the probe triggers where no touch was expected, the routine raises #3000 = n (MESSAGE) instead of driving the stylus through an obstruction. Maker-supplied Mazak routines guard their approach moves this way; some machines add a probe-arm torque alarm on top. |
| Result math | Macro arithmetic on the latched positions — center = mean of two touches, width = difference minus stylus diameter, and tolerance checks with IF[…]GOTO. |
| Writing results | Work offsets via G10 (programmable data setting); tool data through the tool-data-index model from the table above (#3020 to find the index, then #40001+n / #41001+n); workpiece-setup-error corrections through #5801–#5878 on machines with the G54.4 option. |
The double touch, isolated
The pattern is worth seeing on its own, because every measuring routine on the EIA side is repetitions of these four lines. A fast skip move has real latency error in it — the axis is moving quickly when the signal fires, so the latched position scatters. The slow second touch is where repeatability comes from:
G31 Z-15. F800. ; fast find: locate the surface roughly
G01 Z[#5063+1.] F1000. ; back off 1 mm from the latched Z
G31 Z-15. F60. ; slow gauge: the actual measurement
#104=#5063 ; copy the latch before anything overwrites it
Calibration data on the EIA side lives wherever your macros put it — by convention in the power-off-retained common variables #500–#999, exactly as the Renishaw packages do on Fanuc. At minimum a hand-rolled library needs the probe’s effective stylus diameter (measured against a known bore or gauge, per approach direction if you want the last few microns) and the stylus XY offset from the spindle centerline; a center measurement forgives both, a size or single-surface measurement forgives neither.
A complete worked example — probe a boss center in X with two double-touches, compute the center, correct the active work offset, and stop if the deviation is out of band. Assumes a ø50 boss nominally centered at X0 in G54, probe in the spindle with its length offset active, and Z already at probing depth beside the boss:
(O8100 BOSS CENTER IN X)
G90 G54 G00 X-32. Y0. ; clear of the -X flank (surface nominal X-25.)
(FIRST SIDE: FAST FIND, BACK OFF, SLOW GAUGE)
G31 X-22. F800. ; fast find toward +X, target past the surface
G01 X[#5061-1.] F1000. ; back off 1 mm from the latched touch point
G31 X-22. F60. ; slow gauging touch - this one is the measurement
#101=#5061 ; latched X of the -X flank
G00 X-32. ; retract clear
G00 Z25. ; lift over the boss
X32. ; cross to the +X side (surface nominal X+25.)
Z-5. ; back down to probing depth
(SECOND SIDE)
G31 X22. F800. ; fast find toward -X
G01 X[#5061+1.] F1000. ; back off 1 mm
G31 X22. F60. ; slow gauging touch
#102=#5061 ; latched X of the +X flank
G00 X32. ; retract clear
(CENTER MATH - STYLUS BALL RADIUS CANCELS FOR A CENTER)
#103=[#101+#102]/2 ; measured center = deviation from nominal X0
(TOLERANCE GATE BEFORE TOUCHING THE OFFSET)
IF[ABS[#103]GT0.5]GOTO900 ; more than 0.5 mm off? something is wrong
G91 G10 L2 P1 X#103 ; shift G54 X by the deviation (incremental write)
G90 ; back to absolute - do not leave G91 active
G00 Z100.
M30
N900 #3000=101(BOSS CENTER OUT OF BAND)
M30
Two details worth internalizing: the stylus ball radius drops out of a center measurement (both touches are offset the same amount, in opposite directions), but it does not drop out of a width or diameter — measuring the boss’s size from #102-#101 requires a calibrated effective stylus diameter. And verify the G10 L/P words against your machine’s EIA/ISO programming manual before trusting an offset write — then confirm the first correction on the POSITION display before running parts on it.
Extending the pattern is straightforward: add the same pair of double-touches in Y and you have a full boss center; probe from inside instead of outside and it is a bore; wrap the whole thing in a G65 macro taking the nominal size and tolerance as arguments (the standard A→#1 … Z→#26 mapping from the EIA article) and you have the beginnings of your own cycle library — at which point it is usually cheaper to buy the finished one, which is the next section.
Renishaw Packages on Mazak
Nobody hand-writes a full inspection library, and on Mazak you don’t have to: Renishaw supplies Inspection-Plus-style macro suites for Mazak EIA/ISO. Mechanically they work exactly like the Fanuc version — a set of O-numbered macro programs loaded into the control, called with G65 P… plus letter arguments, doing protected positioning, double-touch measurement, tolerance checking, and offset updates internally, with results reported back in #100-range common variables for your program to act on. The maker-supplied probing routines shipped on Mazaks are Renishaw-copyrighted programs of this kind — the O2074099xx family quoted in the EIA article is one of them.
What this page deliberately does not give you is a cycle-number map. The O-numbers, argument letters, and output-variable assignments are defined by the specific package version installed on your machine, and they are not guaranteed to match the Fanuc Inspection Plus numbers. The package’s own programming manual — usually in the machine’s document set, or printed by the installer — is the authority; the calling pattern (calibrate first, protected-position to the feature, call the measuring cycle, read the outputs before the next cycle overwrites them) carries over from the Fanuc version one-for-one. In skeleton form — the Pxxxx numbers below are deliberately placeholders to be filled from your package’s manual:
(PACKAGE PROBING SKELETON - CYCLE NUMBERS FROM YOUR PACKAGE MANUAL)
Txx M06 ; load the spindle probe
G43 Hxx Z100. ; probe length offset active before any cycle
G65 Pxxxx X0. Y0. Z10. F3000. ; protected positioning to clearance over the feature
G65 Pxxxx Z-8. ; protected plunge into the bore
G65 Pxxxx D25. ; measuring cycle - e.g. bore, nominal 25 mm
#110=#1xx ; copy the package's output variables (#100-range)
#111=#1xx ; before the next cycle overwrites them
IF[ABS[#111]GT0.05]GOTO900 ; act on the result in your own program
...
N900 #3000=102(BORE OUT OF TOL)
The disciplines the Fanuc article spells out apply unchanged: tool length offset active before any cycle, protected positioning for every move near the part, calibration cycles run before the first measurement, and outputs copied out immediately.
Which Side to Probe On
| Job | Probe on | Why |
|---|---|---|
| Setup: find the workpiece zero, first-article pickup | MAZATROL side | The coordinate-measurement screens and MMS unit write the WPC directly — no code, no math, no transcription errors. |
| Tool length / diameter setting | MAZATROL side | Tool eye / laser routines land results straight in TOOL DATA, which both languages read. |
| In-process gauging inside a G-code program | EIA macros | The measurement has to live in the program flow — bore a hole, measure it, cut a finish pass sized from the result. |
| Adaptive loops (re-cut until in tolerance, wear compensation) | EIA macros | Needs IF/WHILE logic and offset writes — that is macro territory. |
| SPC / data capture across parts | EIA macros | Results in #-variables can be logged, counted, and trended; package cycles have print/report options for exactly this. |
| MAZATROL part that needs one in-process measurement | Mixed program | Keep the MAZATROL main program and splice the probing in the way the MAZATROL article describes program mixing: a MANUAL PROGRAM unit holding the skip code inline, or a Subprogram unit calling an EIA probing program that inherits the main program’s WPC. |
What a mixed program looks like as a unit sheet — a MAZATROL main program that roughs a bore, probes it in-process, and finishes with a corrected offset:
| UNo. | Unit | Contents |
|---|---|---|
| 0 | COMMON | Material, INITIAL-Z |
| 1 | WPC | Workpiece zero — set by probing at setup (or an MMS unit re-measures it here each cycle) |
| 2 | CIRC MIL | Rough the bore, leaving finish stock |
| 3 | Subprogram | Call the EIA probing program — double-touch measurement, result into a retained common variable / wear offset. Inherits the main program’s WPC. (A MANUAL PROGRAM unit holding the skip code inline works for short routines; remember its first block needs an absolute three-axis position under multi-workpiece machining.) |
| 4 | CIRC MIL | Finish pass, now running with the corrected data |
| 5 | END | — |
The short version: if the answer goes into setup data (WPC, tool data), use the conversational side. If the answer changes what the program does next, use EIA macros — even under a MAZATROL main program.
Gotchas
- Calibration is one job, not two. Stylus runout and the probe’s trigger deadband (the pre-travel before the signal fires, which differs by direction and approach speed) affect MAZATROL-side measurement and EIA-side skip moves identically — there is one physical probe. Calibrate it on a known reference, and re-verify after any stylus change or crash, no matter which side you probe from.
- Gauge at the speed you calibrated at. The deadband is folded into the calibration values at a specific touch feedrate. A slow gauging touch at a different feed than the calibration touch reintroduces the error the calibration removed.
- Skip variables are positions, not measurements.
#5061–#5076are per-axis position captures at the trigger instant. They only become a size, a center, or a deviation after your math accounts for approach direction, stylus geometry, and the coordinate system you read them in. A raw skip position is never the answer by itself. - Read the latch before the next G31. Each skip move overwrites the captured positions. Copy what you need into local or common variables immediately — the same discipline as copying a Renishaw cycle’s outputs before the next call.
- Diameter vs. radius on the turning side. On an Integrex or other turning-capable Mazak, X in the program is conventionally a diameter, while a skip capture is a position. Writing a probed X result into a lathe offset without settling which convention each number is in produces an error of exactly 2× — see Mazak Turning Programming for the diameter-programming rules (and
G10.9for the data-input selection). - Unverified offset writes scrap parts quietly. A wrong sign or a doubled correction in a
G10write moves every subsequent part. Gate every automatic offset update with a sanity band (as in the example’sIF[ABS[#103]GT0.5]) so a bad touch raises an alarm instead of relocating your work offset. - The two worlds share one tool table. An EIA probing macro that writes tool data through
#40001+nchanges the same TOOL DATA the MAZATROL side reads under that tool — that is the point when compensating wear, and a hazard when a macro writes the wrong index. Resolve the index from#3020at runtime; never hard-code it. - Decimal points on skip targets. The Mazak EIA rule that a value without a decimal point is read in the least input increment applies to probing moves too:
G31 X-22targets 0.0022 mm, not −22 mm — the probe never reaches the surface and the routine fails or mis-measures. Decimal-point every dimensional word. - Probe activation M-codes are machine-specific. Spindle probes are typically armed and disarmed (optical/radio link on and off) by machine-configured M-codes, and maker routines wrap them in their own subprograms. Those codes are not in the EIA manual’s defined list — look them up for the specific machine, never copy them from another Mazak.
▶ Open the Macro Playground — pick the Mazak control, set skip inputs like #5061, and run the center/offset math from this page with live variable values in your browser.
See also: Mazak EIA/ISO Programming for the full #-variable and macro language, MAZATROL Conversational Programming for units and program mixing, Mazak Turning Programming for diameter conventions, and Fanuc Renishaw Inspection Plus for the package calling pattern in full.
References
- Yamazaki Mazak, Programming Manual (for Machining Centers) — EIA/ISO, MAZATROL SmoothAi, Manual No. H747PB1000E, 02.2020.
- Yamazaki Mazak, MAZATROL SmoothAi / SmoothG Programming Manual (MAZATROL Program, for Machining Centers), Manual Nos. H747PA1000E / H749PA1003E.
- Renishaw, Inspection Plus / machine-tool probe package programming manuals (version installed on the machine), Renishaw plc.
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch