G30

Machining center, LatheOne-shot, group 00

2nd (3rd, 4th) reference point return

Format and notes

G91 G30 P2 Z0 (2nd reference point if P is omitted)

Diagram: G30: return to 2nd reference point via intermediate point

G30 motionStartIntermediate point(commanded coordinates)2nd reference pointReturning ZZ reference (machine)Workpiece (top = Z0)G91 G30 Z0Straight up from hereG90 G30 Z0Via Z0 (top face)
Same motion as G28, but the destination is the reference point registered in the machine (e.g., tool change position). The commanded coordinates are the intermediate point on the way.

Differences between controls and machines

The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.

SourceMachineItemDetail
HaasMachining centerAvailabilityG30 not in the listG30 is not listed in the Haas mill and lathe G-code lists (only G28/G29)

Frequently asked questions about G30

What is G30 (2nd (3rd, 4th) reference point return) used for and how is it formatted in a CNC program?
G30 commands "2nd (3rd, 4th) reference point return" on Machining center, Lathe. The standard program format is "G91 G30 P2 Z0 (2nd reference point if P is omitted)". The tool change position, etc., is set on the machine as the 2nd reference point and the tool returns there
Is G30 a modal code or a one-shot (non-modal) code?
G30 is a one-shot (non-modal, Group 00) code. It acts only in the single block where it is written and does not carry over to the next block, so you must write G30 on every line where that action is required.
Does G30 work differently on machining centers (mills) versus CNC lathes?
G30 is primarily used on Machining center, Lathe. Depending on the machine type and the lathe G-code system (System A, B, or C), this code may be unavailable or assigned to a different function, so verify against your machine tool manual.
Are there differences in G30 across FANUC, Mitsubishi, Okuma, Haas, and Siemens controls?
Yes. Control builders such as FANUC, Mitsubishi Electric (M80/M800), Okuma (OSP), Haas, Mazak, Siemens (SINUMERIK ISO dialect), and Heidenhain can differ in argument letters, decimal-point rules, and optional parameters for G30. Review the control comparison table above and verify the exact syntax in your machine’s programming manual before proving out the program.

Sources

The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.

  1. Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Milling, 04.2007 Edition (6FC5398-7BP10-0BA0) cache.industry.siemens.com
  2. Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Turning, 04.2007 Edition cache.industry.siemens.com
  3. National Institute of Standards and Technology (NIST), USA — The NIST RS274NGC Interpreter – Version 3 (NISTIR 6556, 2000) nvlpubs.nist.gov
  4. Haas Automation, Inc. — Mill Operator's Manual – 17 Mill G-Codes (online version) haascnc.com