Skip to main content
CNC.wikiCNC.wiki

G80 Canned Cycle Cancellation: CNC Programming and Safety Guide

Master G80 canned cycle cancellation on Fanuc, Siemens, and Mitsubishi CNC controls. Prevent catastrophic turret crashes and resolve PS0044 or P230 alarms.

Hakan Gündoğdu
Hakan Gündoğdu

CNC CARE Co-founder

Introduction: The Spindle and Turret Collision Risk

Omitting a G80 canned cycle cancellation command after a drilling operation leaves the CNC controller armed in a highly dangerous modal state. When an operator subsequently commands a standard X-axis or Y-axis rapid positioning move to clear the part, the machine interprets these new coordinates as the next hole location and instantly plunges the spindle. The operator sees a rapid, uncommanded descent and hears a violent crash as the high-speed tool drives directly into a workpiece clamp or the rotating chuck. This hard collision instantaneously shatters the solid carbide drill, deforms the spindle bearings, and ruins the high-precision workpiece, converting it into a costly scrap part. To avert these mechanical disasters, standard machining practice mandates programming a G80 modal cancellation immediately after the final hole coordinate, deactivating standard hole-making canned cycles like the high-speed peck drilling cycle g73-pattern-repeating-cycle before any reference return or tool change is initiated.

Technical Summary

FeatureSpecification
Command CodeG80 (Canned Cycle Cancellation / Drilling Cycle Cancel)
Modal GroupGroup 09 (Fanuc M / Mitsubishi) / Group 10 (Fanuc T / Siemens) — Modal Cycle Cancellation
Compatible BrandsFanuc, Siemens, Mitsubishi
Critical ParametersFanuc: 7612#0 (RSH), 7700#0 (HBR), 25651#0 (OST), 7731#0 (EFX); Siemens: $SCS_ISO_M_DRILLING_TYPE; Mitsubishi: #19001, #1223
Main ConstraintRetains active feedrates (F) and spindle speeds (S) in memory; peripheral spindle/coolant behaviors are dictated by MTB PLC ladder configurations.

Quick Read: Best Practices for Canned Cycle Cancellation

  • Program an explicit G80 command in a standalone block immediately after the final coordinate of any hole-making canned cycle.
  • Never command a reference position return (G28 / G30) while a canned cycle is active to prevent throwing a Fanuc PS0044 alarm.
  • Avoid programming Group 01 motion commands in the exact same NC block as the cycle call, as they act as implicit deselection triggers that cancel the cycle before execution.
  • Verify machine-specific parameters like Mitsubishi #19001 to control whether the spindle speed (,S) is retained or cancelled during synchronous tap returns.
  • Deactivate active cutter radius compensation (G41 / G42) using G40 before entering a canned cycle to prevent Siemens alarm 61815 or Mitsubishi alarm P155.
  • Do not stack macro or cycle calls (such as combining G80 and G65 / G66 in the same block) to avoid triggering Siemens alarm 12722.

Basic Concepts of Canned Cycle Cancellation

The G80 command is a critical modal cancel code designed to cleanly purge modal coordinate values, peck increments, retract heights, and dwell times from the CNC controller's memory. Canned cycles (such as drilling, tapping, and boring cycles G81 through G89) are modal operations, meaning they remain active and repeat their programmed movements at every subsequent coordinate entered. By issuing G80, the programmer signals to the controller that the automatic cycle is complete, resetting the active G-code group to standard linear or circular positioning. This deactivation prevents the machine from executing unexpected drilling motions during subsequent traverse moves.

Safe use mandates that programmers actively verify the active modal state before executing transition moves. Omitting G80 leaves the machine armed, meaning subsequent linear movements will be interpreted as new hole coordinates. This can drive the tool directly into a workpiece clamp, fixture, or chuck, resulting in broken tooling, a bent spindle, and scrapped parts. Programmers must ensure that the cancel command is explicitly entered before initiating tool changes or calling subprograms. This modal cleanup is especially crucial when transitioning from synchronous tapping cycles—which are governed by corner control logic like g62-g63-corner-override-tapping—to standard interpolation modes.

Command Structure and Syntax

The G80 command is typically programmed as a standalone block immediately after the coordinate of the final hole in a cycle sequence. The standard syntax requires no additional address values or coordinates to deactivate the active cycle group. Once executed, it successfully clears all active canned cycle data, ensuring subsequent blocks are interpreted strictly as standard movement instructions.

Depending on the control brand and specific software options, G80 can accept auxiliary addresses. For instance, when utilizing specialized synchronization functions or advanced electronic gearing, G80 shifts its function to accept specific retraction or decoupling arguments. Programmers must ensure they apply the correct syntax format matching their controller's configuration.

Command Syntax Formats:

  • Standard Modal Cancel (All Brands): G80;
  • Fanuc EGB Phase Synchronization Cancel: G80 R_;
  • Fanuc Two-Pair EGB Synchronization Cancel: G80.5 β0; (where β represents the slave axis)
  • Siemens Standalone ISO Dialect Cancel: G80;
  • Mitsubishi Standalone Group 09 Cancel: G80;

Controller Parameters Influencing Cancellation

BrandParameterDescription & Values
Fanuc7612#0 (RSH) / 7700#0 (HBR)EGB synchronous mode termination upon machine reset: 0 cancels sync on reset; 1 retains sync (requires G80/G80.5).
Fanuc25651#0 (OST)Retract behavior when G80/reset is executed during oscillation cycle: 0 moves oscillation axis to R point and stops; 1 stops immediately.
Fanuc7731#0 (EFX)Command set selection for EGB / flexible synchronization: 0 uses G80 and G81; 1 uses G80.4 and G81.4.
Siemens$SCS_ISO_M_DRILLING_TYPESystem variable defining the retraction distance inside ISO dialect cycles.
Mitsubishi#19001 Syn.tap(,S)cancelSelects whether to retain spindle speed during synchronous tap return: 0 retains speed; 1 cancels spindle speed with G80.
Mitsubishi#1223 aux07/bit6Handshake parameter working with #19001 for synchronous tap spindle speed control (synchronized with #19001).

Brand-Specific Applications

Fanuc Applications

On Fanuc systems, G80 is a modal cancel command that purges the active Group 09 canned cycle from memory, ensuring that subsequent coordinate positioning blocks do not execute a spindle plunge. First, Fanuc incorporates parameter 7612#0 (RSH) or parameter 7700#0 (HBR) to dictate EGB synchronous mode termination upon machine reset. Second, Fanuc integrates parameter 25651#0 (OST) to govern retract behavior when G80 is executed during active oscillation cycles.

The G-code is typically commanded as a standalone block: G80; immediately following the last coordinate of the hole-making pattern, deactivating the cycle before any reference return is commanded.

CategoryParameter / Alarm / VersionTechnical Details
ParameterParameter 7612#0 (RSH)EGB synchronous mode termination upon machine reset: 0 cancels sync on reset; 1 retains sync.
ParameterParameter 7700#0 (HBR)EGB synchronous mode retention: works with RSH to maintain synchronization unless explicitly cancelled.
ParameterParameter 25651#0 (OST)Oscillation cycle retract: 0 retracts oscillation axis to R point and stops; 1 stops immediately.
ParameterParameter 7731#0 (EFX)Command set selection for EGB: 0 uses G80/G81; 1 uses G80.4/G81.4.
Alarm CodeAlarm PS0044 (Alarm 044)Reference position return (G27-G30) commanded while canned cycle is active without G80.
Alarm CodeAlarm PS0187 (Alarm 187)Hobbing synchronization (G81/G81.4) started while standard drilling cycle is active without prior G80.
VersionsM series vs T seriesM series maps G80 to Group 09 (drilling, boring, tapping); T series maps G80 to Group 10 (drilling cycles).
VersionsEGB OptionIncludes specialized variants G80.4 (hob sync cancel) and G80.5 (EGB 2-pair sync cancel) on equipped machines.

Warning: Omitting the G80 command before issuing a reference point return (G28/G30) will trigger alarm PS0044, immediately halting the machine and stopping production due to safety state conflicts.

Siemens Applications

The Siemens Sinumerik controller implements G80 to immediately return the machine to standard motion mode, terminating modal fixed cycles. Crucially, Siemens handles G80 through an ISO dialect parser that captures coordinates and remaps them to standard system variables. Spindle and axis speed limits are strictly monitored by the NCK (Numerical Control Kernel), and the controller integrates system variable $SCS_ISO_M_DRILLING_TYPE to manage retraction distance inside ISO dialect cycles.

In Siemens ISO Dialect Mode, G80 is typically commanded as a standalone block: G80; or combined with a safe rapid retraction and program end block: G00 G80 Z50 M30;.

CategoryParameter / Alarm / VersionTechnical Details
Parameter$SCS_ISO_M_DRILLING_TYPESystem variable defining the retraction distance inside ISO dialect cycles. Real value.
Alarm CodeAlarm 12722Stacking multiple ISO dialect macro or cycle calls (like G80 and G65/G66) in the same NC block.
Alarm CodeAlarm 61815Cutter radius compensation (G41/G42) active when a canned cycle is called.
Alarm CodeAlarm 61819Risk of collision on retraction (tool violates programmed contour during retraction).
VersionsISO Dialect ModeG80 is universally mapped to Group 10 "Drilling cycle off" across ISO Dialect M and T (Systems A, B, C).
VersionsShell Cycle BackendSiemens captures ISO dialect parameters via system variables and transfers them to a hidden native standard cycle (CYCLE381M/CYCLE383T).

Warning: Ensure cutter radius compensation G41/G42 is completely deactivated with G40 before entering a canned cycle to prevent tool compensation conflicts and triggering alarm 61815.

Mitsubishi Applications

Mitsubishi systems utilize G80 to terminate active hole-machining modes and purge modal data from the CNC's memory. Crucially, Mitsubishi includes parameter #19001 to determine spindle speed (,S) cancellation behavior and parameter #1223 aux07/bit6 as a handshake parameter to control the tapping spindle speed during cancellation.

The G-code is typically commanded as: G80; to clear Group 09 states, or implicitly cancelled when a Group 01 interpolation command is programed in the block.

CategoryParameter / Alarm / VersionTechnical Details
ParameterParameter #19001Syn.tap(,S)cancel: 0 retains tapping speed in synchronous tap return; 1 cancels tapping speed with G80.
ParameterParameter #1223 aux07/bit6Handshake parameter working with #19001 for synchronous tap spindle speed control. Range: 0 or 1.
Alarm CodeAlarm P230Calling a G, M, S, T, or B macro code while a fixed cycle is still active without G80.
Alarm CodeAlarm P29Executing incompatible modal command (e.g. G61.2 high-accuracy spline, G51.1 mirror image) during active cycle.
VersionsM system vs L systemM system cancels Punchtap (G84.5/G74.5) and Thread Milling (G187); L system cancels turning hole cycles like Hole edge chamfering (G185).

Warning: Attempting to call a user macro code (via G, M, S, T, or B) before issuing G80 will cause the Mitsubishi controller to halt execution and trigger alarm P230, stopping spindle motion.

Comparative Analysis of Brand Implementations

TopicFanucSiemensMitsubishi
Backend ArchitectureHardcoded canned cycle logic executed directly.Shell cycle backend captures parameters and maps them to a native SINUMERIK cycle (e.g. CYCLE381M or CYCLE383T).Standard hardware cycles or specialized custom routines.
Implicit CancellationAborts drilling canned cycle when any Group 01 motion command (G00, G01, G02, G03) is programmed.Pervasive cancellation by any Group 01 G function (G00, G03, G33, etc.).Treats Group 01 linear/circular motion exactly like a manual G80 command.
Synchronous / EGB decouplingServes as specialized phase sync cancel (G80 R1 / G80 R2) or 2-pair EGB sync cancel (G80.5).— (no source)Natively integrates with parameters #19001 and #1223 to selectively retain or cancel spindle speed (,S) in synchronous tapping.
Address Zeroing— (no source)— (no source)Instantly clears and zeroes out physical chip-removal parameters (D spindle number, E frequency) upon cancellation.

Technical Deep Dive

Analyzing the brand architectures reveals substantial differences in how canned cycle data is managed and cancelled. Siemens distinguishes itself through its unique shell cycle backend. When an ISO G-code canned cycle is programmed, the controller does not run hardcoded ISO logic; instead, it intercepts the addresses, stores them in internal system variables, and executes a native Sinumerik background cycle like CYCLE381M. This shell cycle architecture abstracts the execution, ensuring that coordinate systems remain consistent. Upon receiving a G80, the Siemens control terminates the backend cycle execution and restores standard channel coordinates.

Mitsubishi controls feature a specialized address zeroing behavior that is completely unique. When G80 is executed, the control instantly zeroes out the spindle selection address (D) and frequency (E) that were designated for specialized chip-removal operations. This address-clearing mechanism ensures that no residual chip-breaking variables remain in memory to conflict with subsequent standard contouring moves. Additionally, Mitsubishi utilizes parameter #19001 in combination with parameter #1223 to let operators choose whether the tapping spindle speed (,S) is cleared or retained after synchronous tapping cycles, giving programmers granular control over spindle state hygiene.

Fanuc, by contrast, maps G80 to serve a critical dual purpose. While it is universally recognized as a drilling cancel code, on machines equipped with the Electronic Gear Box (EGB) or Hobbing options, G80 dynamically shifts its function to act as a phase synchronization cancel command. When programmed as G80 R1 or G80.5, it physically decouples the electronic gearing between the master and slave axes. This allows Fanuc to utilize a single modal G-code to handle both drilling cycle deactivation and synchronous axis decoupling, streamlining the active code group structure.

Program Examples and Dry Run Analysis

Fanuc Program Example

G90 G54 G00 X0 Y0 Z50.0 S1500 M03;
G43 H01 Z10.0 M08;
G99 G81 Z-20.0 R2.0 F150.0;
X25.0 Y25.0;
X50.0 Y50.0;
G80 G00 Z50.0 M09;

dry run: When this Fanuc program is executed, the controller first establishes absolute coordinates and rapid-traverses to the X0 Y0 start position, rotating the spindle at 1500 RPM. The tool length offset H01 is applied, bringing the tool tip to Z10.0 with coolant activated. The G81 command enters the Group 09 modal state, commanding the Z-axis to plunge to Z-20.0 at 150.0 mm/min, and then rapidly retract to the R-plane at Z2.0. The controller retains these canned cycle parameters. In the subsequent blocks, the tool moves to X25.0 Y25.0 and X50.0 Y50.0; at each location, the control detects new coordinates under the active modal state and automatically repeats the spindle plunge. Finally, the G80 block is executed, which instantly purges the modal depth, feed, and retract parameters, restoring standard Group 01 rapid traverse so the tool can safely retract to Z50.0 and disable coolant without repeating the cycle.

Siemens Program Example

G90 G54 G00 X0 Y0 Z50.0 S1200 M03;
G00 Z10.0 M08;
G99 G83 Z-30.0 R3.0 F200.0;
X30.0 Y30.0;
G80 G00 Z50.0 M09;

dry run: Under the Siemens Sinumerik ISO dialect parser, the controller initiates rapid movement to the origin at Z50.0, starting the spindle at 1200 RPM. The tool descends to Z10.0 and enables coolant. The G83 block is parsed, and the controller stores the coordinate parameters (Z-30.0, R3.0, F200.0) into system variables, triggering the native CYCLE383T shell cycle to execute a deep peck-drilling operation. The tool pecks to depth and retracts to Z3.0. Moving to X30.0 Y30.0, the backend cycle automatically executes a second hole. Finally, the block containing G80 is parsed; the controller instantly deactivates the shell cycle variables, returning the channel to standard linear motion. The tool rapid-traverses safely to Z50.0, and M09 disables the coolant flow.

Mitsubishi Program Example

G90 G54 G00 X0 Y0 Z50.0 S1000 M03;
G00 Z10.0 M08;
G91 G83 X-50. Z-50. R-50. Q-10. P3000 F2000 K3 D1 E2;
G80 G90 G00 Z50.0 M09;

dry run: In this Mitsubishi incremental drilling program, the tool rapid-traverses to X0 Y0 Z50.0 and turns on the spindle. The tool moves to Z10.0 and enables coolant. The G83 command activates Group 09 modal behavior, executing a peck-drilling sequence with incremental parameters: peck depth Q-10., dwell P3000 (3 seconds), feed F2000, 3 repetitions (K3), spindle selection D1, and chip-removal frequency E2. The tool plunges, dwells, pecks, and retracts increment-by-increment. Finally, the G80 command is executed. The Mitsubishi controller instantly clears the active drilling cycle modal states and zeroes out the D and E chip-breaking parameters. The G90 restores absolute positioning, allowing the tool to rapid-traverse safely to Z50.0 with coolant off.

Error Analysis and Diagnostic Troubleshooting

Brand & Alarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
Fanuc Alarm PS0044Reference position return (G27-G30) commanded while canned cycle is still active.The CNC channel halts immediately, displaying PS0044 REFERENCE POSITION RETURN ERROR on the CRT screen.The programmer omitted the G80 command after the final hole coordinate. Fix: Insert an explicit G80; block immediately after the drilling pattern.
Fanuc Alarm PS0187Hobbing synchronization (G81/G81.4) started while standard drilling cycle is active without prior G80.Spindle rotation halts and the controller triggers PS0187 HOBBING CYCLE conflict.The drilling cycle state remains modal in memory, conflicting with the EGB synchronous command. Fix: Program G80; to purge modal registers before calling G81/G81.4.
Siemens Alarm 12722Stacking multiple ISO dialect macro or cycle calls (like G80 and G65/G66 or M macros) in the same block.The channel stops parsing, displaying Alarm 12722: Illegal stacking of macro/cycle calls.The G80 command was combined with a macro call in a single block. Fix: Program the G80; command in its own dedicated block.
Siemens Alarm 61815Cutter radius compensation (G41/G42) is active when a canned cycle is called.The preprocessor locks out axis movement, flashing Alarm 61815: Cutter compensation active in cycle.The programmer failed to deactivate tool nose/cutter radius compensation. Fix: Program a G40; command before the canned cycle block.
Mitsubishi Alarm P230Calling a G, M, S, T, or B macro code while a fixed cycle is still active.Execution freezes instantly and the screen triggers P230 MACRO CALL IN FIXED CYCLE.The programmer attempted to run a macro subroutine before the active drilling cycle was cancelled. Fix: Insert G80; to clear the cycle before calling the macro.
Mitsubishi Alarm P29Executing incompatible modal command (e.g. G61.2 high-accuracy spline, G51.1 mirror image) during active cycle.The active channel goes into a feed-hold state and displays P29 ILLEGAL G-CODE IN FIXED CYCLE.An incompatible advanced contouring mode was activated while the drilling cycle was still modal. Fix: Program G80; to cancel the cycle before commanding G61.2 or G51.1.

Professional Application Note

Managing the active modal state is a paramount safety requirement when designing drilling sequences on machining centers equipped with high-torque spindles and heavy coordinate tables. When an operator omits the G80 cancel command after a deep-hole drilling sequence, the active G-code group remains configured in drilling mode. If the operator subsequently commands a standard X-axis or Y-axis rapid positioning move to reposition the table, the controller interprets the coordinates as the next hole location and instantly initiates a spindle plunge. The operator sees a rapid, uncommanded descent and hears a violent crash as the active tool drives directly into a workpiece clamp or the side of a vise jaw. This hard collision shatters the tool, deforms the spindle bearings, and bends the coordinate ball screws, instantly stopping production and producing an expensive scrap part. To prevent this, standard shop safety mandates that G80 is programmed immediately after the last hole coordinate, guaranteeing the cycle is dead before any reference returns are invoked, which prevents safety logic intervention and diagnostic alarms.

Related Command Network

  • G73, G74, G76, G81–G89: Represents the complete suite of hole-making and threading canned cycles that are deactivated by the modal G80 command.
  • G80.4 / G80.5 (Fanuc): Specialized Fanuc command variations used to terminate Electronic Gear Box (EGB) and flexible synchronization relationships.
  • G00, G01, G02, G03: Standard Group 01 interpolation commands that act as implicit cancellation triggers across all three control brands.
  • CYCLE381M / CYCLE383T / CYCLE840 (Siemens): Native background Siemens Sinumerik cycles that receive the translated ISO parameters when G80 or a cycle call is issued.
  • G185 / G187 (Mitsubishi): Turning-specific chamfering and thread milling cycles in Mitsubishi systems that are cancelled dynamically via G80.

Practical Takeaways

Maintaining absolute state hygiene by explicitly programming the G80 canned cycle cancellation command is essential for preventing tool damage and mechanical collisions. While implicit cancellation via Group 01 motion codes provides a programming shortcut, relying on it increases the risk of unexpected spindle plunges if coordinates are modified without an explicit G-code prefix. Programmers must ensure G80 is executed in its own block immediately after the final hole coordinate, deactivating active coordinate registers and resetting the modal group. Calibrating controller parameters, resolving compensation states, and ensuring G80 clears active cycles before reference returns are commanded will guarantee stable and collision-free automatic operations across Fanuc, Siemens, and Mitsubishi controls.

Frequently Asked Questions

Why does failing to command G80 before a G28 reference return trigger a Fanuc PS0044 alarm?

When a canned cycle remains active, the CNC controller holds modal hole-making coordinates and parameter states in active memory. Issuing a reference return command (G28 or G30) under an active cycle causes a coordinate conflict between the cycle's return planes and the machine's absolute home reference return path. The controller's safety logic triggers Alarm PS0044 to prevent mechanical conflicts. Practical Action: Always place a G80 cancel command in a standalone block immediately after the last hole coordinate and before coding any G28 or G30 commands.

What is the benefit of implicit cancellation via Group 01 commands, and why is explicit G80 still recommended?

Implicit cancellation allows standard positioning commands (G00, G01, G02, G03) to automatically purge active canned cycles, which streamlines program execution when transitioning to milling or turning contours. However, relying solely on implicit triggers increases the risk of operator oversight if a coordinate is moved without a Group 01 prefix, causing the machine to plunge modal drill parameters unexpectedly. Practical Action: Always explicitly program G80 at the end of every hole-making sequence to maintain clean modal hygiene and guarantee the cycle is dead before any axis movements are executed.

How does Mitsubishi's parameter #19001 modify the standard behavior of G80 during synchronous tapping?

In standard setups, cancelling a synchronous tapping cycle with G80 retains the active tapping spindle speed (,S) in modal memory, which can lead to unintended spindle rotations when standard milling is resumed. Toggling parameter #19001 (along with #1223 aux07/bit6) to a value of 1 forces the G80 command to automatically cancel the tapping spindle speed along with the coordinate data when the cycle ends. Practical Action: Verify the setting of parameter #19001 on the Mitsubishi controller to ensure the tapping spindle speed behavior is synchronized with your post-cycle safety procedures.

Still not resolved?

Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

Ask AI Assistant
Hakan Gündoğdu
Hakan Gündoğdu
  • CNC CARE Co-Founder (May 2025 - Present)
  • Mitsubishi Electric NC Sales & Service Section Manager (2008 - 2025)
  • Reis CNC Service Engineer (2003 - 2005)
  • Ören Kalıp CNC Mold Line Team Leader (1999 - 2002)

With over 25 years of experience working in all areas of the CNC machine industry, I continue my activities as a co-founder of CNC CARE, where we offer brand-independent consulting, engineering, and original spare parts services.

Related Articles

Other articles on this topic