G-code reference
G27 G-Code: Reference Position Return Check
Reference Position Return Check — Moves to the commanded position at rapid and checks that it is the reference (home) position; the reference lamp lights if correct, otherwise an alarm is…
| Property | Value |
|---|---|
| Code | G27 |
| Function | Reference Position Return Check |
| Modal group | 00 |
| Type | One-shot (non-modal) — active only in its own block |
| Used on | Mills and lathes |
| Syntax | G27 X_ Y_ Z_ |
What does G27 do?
Moves to the commanded position at rapid and checks that it is the reference (home) position; the reference lamp lights if correct, otherwise an alarm is raised. It is used to verify that a program finishes at home.
G27 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
G27 X_ Y_ Z_| Address | Meaning |
|---|---|
X Y Z | Machine reference position (usually 0) |
G27 example program
G91 G27 Z0▶ Open this example in the G-code viewer
Tips and common mistakes
- Cancel tool length and cutter compensation first.
Controller compatibility
G27 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.