G-code reference
G37 G-Code: Automatic Tool Length Measurement
Automatic Tool Length Measurement — On Fanuc mills, moves the tool toward a tool-length sensor until it triggers and updates the active H offset with the measured difference. On Fanuc lathes…
| Property | Value |
|---|---|
| Code | G37 |
| Function | Automatic Tool Length Measurement |
| Modal group | 00 |
| Type | One-shot (non-modal) — active only in its own block |
| Used on | Mills and lathes |
| Syntax | G37 Z_ (mill) / G37 Z_ (lathe) |
What does G37 do?
On Fanuc mills, moves the tool toward a tool-length sensor until it triggers and updates the active H offset with the measured difference. On Fanuc lathes (system A) it measures and sets the Z offset.
G37 is a one-shot code: it only acts in the block where it is written, and the previously active modal codes take over again afterwards.
Syntax and parameters
G37 Z_ (mill) / G37 Z_ (lathe)| Address | Meaning |
|---|---|
Z | Measuring position |
G37 example program
T5 M06
G43 H05 Z50.0
G37 Z-100.0▶ Open this example in the G-code viewer
Tips and common mistakes
- Many shops use the probe manufacturer's macros instead (e.g. O9853).
Controller compatibility
G37 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.
Related codes
- G36 — Automatic Tool Compensation X (Lathe)
- G43 — Tool Length Compensation (+)
- G31 — Skip Function (Probing Move)