G-code reference

G36 G-Code: Automatic Tool Compensation X (Lathe)

Automatic Tool Compensation X (Lathe) — Fanuc lathe function (G-code system A) that moves the tool toward a tool-setter arm until the measuring position is reached, then automatically writes the X…

By cnccode · Updated
PropertyValue
CodeG36
FunctionAutomatic Tool Compensation X (Lathe)
Modal group00
TypeOne-shot (non-modal) — active only in its own block
Used onLathes
SyntaxG36 X_

What does G36 do?

Fanuc lathe function (G-code system A) that moves the tool toward a tool-setter arm until the measuring position is reached, then automatically writes the X offset. G37 does the same in Z.

G36 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

Format
G36 X_
AddressMeaning
XMeasuring position

G36 example program

Example
T0101
G36 X150.0

▶ Open this example in the G-code viewer

Tips and common mistakes

  • Requires the tool-setter arm (Q-setter) option and parameters.

Controller compatibility

G36 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.

Frequently asked questions

Is G36 modal?
No. G36 is a one-shot (group 00) code and only acts in the block where it appears.
What does G36 mean in CNC?
G36 means Automatic Tool Compensation X (Lathe). Fanuc lathe function (G-code system A) that moves the tool toward a tool-setter arm until the measuring position is reached, then automatically writes the X offset. G37 does the same in Z.
What is the difference between G36 and G37?
G36 is Automatic Tool Compensation X (Lathe), while G37 is Automatic Tool Length Measurement. See the G37 page for its syntax and examples.
Can I use G36 on a mill?
Usually not with the same meaning: G36 is documented here for lathes. Check your control manual for the equivalent.