G-code reference
G10 G-Code: Programmable Data Input (Set Offsets)
Programmable Data Input (Set Offsets) — Writes offsets from the program into the control: work offsets, tool length and radius offsets. This is useful for setting fixtures automatically and for…
| Property | Value |
|---|---|
| Code | G10 |
| Function | Programmable Data Input (Set Offsets) |
| Modal group | 00 |
| Type | One-shot (non-modal) — active only in its own block |
| Used on | Mills and lathes |
| Syntax | G10 L2 P_ X_ Y_ Z_ (work offset) / G10 L1 P_ R_ (tool offset) |
What does G10 do?
Writes offsets from the program into the control: work offsets, tool length and radius offsets. This is useful for setting fixtures automatically and for probing routines.
G10 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
G10 L2 P_ X_ Y_ Z_ (work offset) / G10 L1 P_ R_ (tool offset)| Address | Meaning |
|---|---|
L2 | Work offsets G54–G59 (P1=G54 … P6=G59, P0 = external/common) |
L20 | Additional work offsets G54.1 P1–P48 |
L1 / L10–L13 | Tool offsets: L10 geometry H, L11 wear H, L12 geometry D, L13 wear D |
P | Offset number |
R | Offset value |
G10 example program
G90 G10 L2 P1 X-350.125 Y-220.400 Z-410.000 (set G54)
G10 L10 P5 R125.433 (tool 5 length geometry)
G10 L12 P5 R5.0 (tool 5 radius)▶ Open this example in the G-code viewer
Tips and common mistakes
- G90 writes absolute values; G91 adds to the existing value.
- A mistake here silently moves every following cut — verify with single block.
- Parameter writing (G10 L50) exists but should be used with great care.
Controller compatibility
G10 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
- G54 — Work Coordinate System 1
- G43 — Tool Length Compensation (+)
- G41 — Cutter Radius Compensation Left
- G54.1 — Additional Work Coordinate Systems