G-code reference

G30.1 G-Code: Set Second Predefined Position (GRBL / LinuxCNC)

Set Second Predefined Position (GRBL / LinuxCNC) — Stores the current machine position as the G30 position on GRBL and LinuxCNC, often used for a tool-change or probe location.

By cnccode · Updated
PropertyValue
CodeG30.1
FunctionSet Second Predefined Position (GRBL / LinuxCNC)
Modal group00
TypeOne-shot (non-modal) — active only in its own block
Used onMilling machines
SyntaxG30.1

What does G30.1 do?

Stores the current machine position as the G30 position on GRBL and LinuxCNC, often used for a tool-change or probe location.

G30.1 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
G30.1

G30.1 example program

Example
G30.1
(later)
G30

▶ Open this example in the G-code viewer

Controller compatibility

G30.1 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 G30.1 modal?
No. G30.1 is a one-shot (group 00) code and only acts in the block where it appears.
What does G30.1 mean in CNC?
G30.1 means Set Second Predefined Position (GRBL / LinuxCNC). Stores the current machine position as the G30 position on GRBL and LinuxCNC, often used for a tool-change or probe location.
What is the difference between G30.1 and G30?
G30.1 is Set Second Predefined Position (GRBL / LinuxCNC), while G30 is Return to 2nd/3rd/4th Reference Point. See the G30 page for its syntax and examples.
Can I use G30.1 on a lathe?
Usually not with the same meaning: G30.1 is documented here for milling machines. Check your control manual for the equivalent.