G67

Machining center, LatheModal, group 12

Modal macro call cancel

Format and notes

G67

Example

G66 P9020 Z-5. R2. F100. ;
X10. Y10. ; (O9020 RUNS)
X30. ; (O9020 RUNS)
G67 ; (CANCEL BEFORE RETRACT)
G00 Z50. ; (NO MACRO CALL)
X0 Y0 ; (NO MACRO CALL)

An example where G67 is written after the second hole (X30 Y10) and before the retract G00 Z50. (O9020 is a macro that drills one hole, the same one as in the G66 page example). If G67 is forgotten, a drilling motion runs again at X30 Y10 after rising to Z50, and again at X0 Y0 after moving there. The values are for illustration.

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 centerAvailabilityG66 and G67 are not in the G-code list (macros are called with G65)
Mitsubishi ElectricLatheNotesG67 cancels both G66 and G66.1. G67 without G66 (G66.1) is a program error

Frequently asked questions about G67

What is G67 (Modal macro call cancel) used for and how is it formatted in a CNC program?
G67 commands "Modal macro call cancel" on Machining center, Lathe. The standard program format is "G67". Cancels G66. State at power-on and reset (Siemens ISO default)
Is G67 a modal code or a one-shot (non-modal) code?
G67 is a modal code (Group 12). Once commanded, it remains active across subsequent blocks until another code from the same modal group overrides it or the control is reset. Always state or cancel modal states explicitly in your safety block and at the end of a tool operation so residual modes do not cause unexpected motion when restarting mid-program.
Does G67 work differently on machining centers (mills) versus CNC lathes?
G67 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 G67 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 G67. 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. Mitsubishi Electric — MITSUBISHI CNC 700/70 Series Programming Manual (Lathe System) (IB-1500057) mitsubishielectric.com
  4. Haas Automation, Inc. — Mill Operator's Manual – 17 Mill G-Codes (online version) haascnc.com