G-code reference
G40 G-Code: Cutter Radius Compensation Cancel
Cutter Radius Compensation Cancel — Cancels G41/G42 cutter (or tool nose radius) compensation. Cancel on a linear move away from the part, not on an arc.
| Property | Value |
|---|---|
| Code | G40 |
| Function | Cutter Radius Compensation Cancel |
| Modal group | 07 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Mills and lathes |
| Syntax | G40 G01 X_ Y_ |
What does G40 do?
Cancels G41/G42 cutter (or tool nose radius) compensation. Cancel on a linear move away from the part, not on an arc.
G40 is modal: once programmed it remains in effect for the following blocks until another code from modal group 07 replaces it or the control is reset.
Syntax and parameters
G40 G01 X_ Y_G40 example program
G01 X-10.0 Y-10.0 G40 (lead-out with cancel)▶ Open this example in the G-code viewer
Tips and common mistakes
- Cancelling on an arc or with no move causes alarms or gouges.
- Keep G40 in your safe start line.
Controller compatibility
G40 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.