Skip to main content
CNC.wiki

G49 Tool Length Compensation Cancel: Fanuc, Siemens & Mitsubishi Guide

Master G49 tool length compensation cancel on Fanuc, Siemens, and Mitsubishi. Learn syntax, parameter configurations like TOS, and fixes for Alarm PS0368.

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

CNC CARE Co-founder

Production Risks and Safety in Tool Length Cancellation

Driving a spindle directly into a table-mounted workpiece clamp, fixture vise jaw, or rotating spindle chuck at rapid feed is the immediate consequence of failing to re-establish tool length offsets after a reference point return. Under Fanuc, Siemens, and Mitsubishi CNC controls, G49 serves as the modal command to cancel tool length compensation (previously activated via G43 or G44). If an operator executes a manual or automatic reference return (such as G28, G30, or G74) and resumes machining without programming an explicit G43 or G44 offset command, the spindle will descend using uncompensated coordinates. This unexpected axis deviation in close proximity to fixtures causes a catastrophic hard collision, shatters the cutting tool, triggers an axis-overload or servo overcurrent alarm, and instantly converts raw stock into a ruined scrap part.

Similarly, attempting to execute a G49 cancellation block while in cutter compensation mode (G41 or G42) under certain shift type parameter configurations disables the look-ahead preprocessor. Because the control cannot pre-read subsequent blocks to calculate intersection vectors, the machine is forced to decelerate to a complete stop at the boundary seam of the cancel block. This unexpected pause causes tool deflection or leaves dwell marks on the contour, leaving a gouged profile that scraps the part. Setup operators and programmers must maintain absolute vigilance regarding coordinate system transitions and reference point returns to prevent crashes.

Technical Summary

PropertySpecification
Command CodeG49 / H0 / H00 (Fanuc, Siemens ISO, Mitsubishi); D0 (Siemens Native)
Modal GroupGroup 08 (Modal Preparatory Function)
Supported BrandsFanuc, Siemens, Mitsubishi
Critical ParametersFanuc No. 5040 (Bit 3 TCT), No. 5006 (Bit 6 TOS), No. 11400 (Bit 2 TOP); Siemens MD 20380, MD 10760, MD 18800, MD 20250; Mitsubishi No. 1268 (Bit 6), No. 1210, No. 1247 (Bit 0)
Main ConstraintSwitching compensation types without G49 triggers alarms. Command G49 at a safe clearance height; axis movement type can trigger physical retraction, whereas coordinate shift type updates coordinate counters silently and requires immediate absolute positioning.

Quick Read

  • Execute G49 or H00 to cancel active G43/G44 tool length offsets before initiating tool changes or format switches.
  • Command G49 only at a safe clearance height to prevent physical tool crashing during axis retraction.
  • Avoid executing G49 inside cutter compensation (G41/G42) to prevent preprocessor look-ahead buffer freeze and dwell marks.
  • Recognize that native Siemens SINUMERIK controls do not support G49; use D0 cutting edge registration to cancel offsets.
  • Perform an absolute travel command (G00 or G01) immediately after canceling offsets under coordinate shift mode to sync physical position.
  • Designate the compensation axis explicitly when issuing coordinate presets (G92.1) during active offsets to avoid program errors.

Basic Concepts

Activating G49 tool length compensation cancel on a CNC milling center removes the active offset coordinates, reverting the coordinate system to its uncompensated state. This command is critical for preparing the spindle for tool changes or safe axis movements. In standard operations, the machine control applies positive or negative offsets to compensate for the difference between the programmed tool length and the physical tool length. The G49 command serves to reset these offsets, ensuring that the control registers the actual machine position rather than a compensated coordinate.

Setup operators and programmers must maintain absolute vigilance regarding coordinate system transitions and reference point returns to prevent crashes. Under standard rules, when zero offsets or reference returns are executed, the retention of offsets depends on control-specific parameters. Failure to track these states results in the tool traveling on an uncompensated path, which drives the turret or spindle into clamps, fixtures, or vise jaws.

Plane selection plays a critical role in how tool length compensation behaves. Programmers must ensure the appropriate working plane (G17, G18, or G19) is active before commanding offsets. This plane configuration determines which axis receives the tool length compensation vector (for example, G17 assigns the length offset to the Z-axis). Changing planes mid-program without first canceling active offsets with G49 or D0 causes the control to compensate along the wrong axis, leading to severe path deviations.

Command Structure and Syntax

The G49 command can be written as an independent block or combined with axis coordinates to control retraction behavior. In its independent form, G49 deactivates the length offset modal state without initiating axis movement. However, depending on machine parameter configurations, the coordinate counter may be updated silently, requiring the programmer to define a new absolute position in the subsequent block.

Alternatively, G49 can be programmed with a target coordinate (e.g., G49 Z100.0) to physically retract the axis while removing the offset. Register-based cancellation is also supported, where specifying offset number H0 or H00 resets the active offset value to zero. In native Siemens controls, cutting edge registers (D codes) are used, where D0 cancels all active length and radius offsets.

  • G49 ; - Standalone cancel block. Deactivates length compensation.
  • G49 Z_ ; - Cancels compensation while retracting the Z-axis (or designated height axis) to the specified coordinate.
  • H0 / H00 ; - Sets the active tool offset register value to zero, canceling the compensation vector.
  • D0 ; - Suppresses all cutting edge offsets in native Siemens mode.

Brand Applications and Parameter Configurations

Fanuc

Fanuc controls require modal Group 23 validation using parameter No. 5040 Bit 3 (TCT) to enable tool length compensation. The cancellation mode can be customized using parameter No. 5006 Bit 6 (TOS) or No. 11400 Bit 2 (TOP) to choose between axis movement and coordinate shift retraction. If coordinate shift type (TOS=1) is active, starting or canceling tool length compensation (G49) while in cutter compensation mode (G41/G42) disables the look-ahead preprocessor, forcing the machine to decelerate to a complete stop at the boundary seam of the cancel block.

Active tool length offsets are canceled in Fanuc by commanding G49 in an independent block or by pairing retraction coordinates with the cancel code, such as G49 Z100.0 H00. Calling H0 also clears the active compensation vector.

  • Parameter No. 5040 Bit 3 (TCT): Tool Change Type. Set to 1 to enable G-code Group 23 (G43, G44, G49). Changing while offsets active triggers Alarm PS0368.
  • Parameter No. 5006 Bit 6 (TOS) / Parameter No. 11400 Bit 2 (TOP): Shift Type. When set to 1, look-ahead buffer processing is suspended during G49 in cutter compensation.
  • Parameter No. 19625: Pre-read look-ahead buffer size limit.
  • Parameter No. 5001 Bit 3 (TAL): Set to 1 to suppress alarms when multi-axis tool length offset commands are performed simultaneously.
  • Parameter No. 5008 Bit 4 (MCR): Triggers Alarm PS5257 if tool offset cancel is attempted in MDI mode when set to 1.
  • Parameter No. 5000 Bit 3 (GNI): Treats G40 cancel block with vector coordinates and no motion as no tool movement when set to 0 on Series 30i/31i/32i-B Plus, changing retraction behavior from legacy controls.
  • Alarm PS0368: Switching offset types without G49, or modifying Parameter 5040 while offsets are active.
  • Alarm PS0325: G49 inside repetitive roughing cycles.
  • Alarm PS5257: Radius/length cancel in MDI with MCR=1.

Under Fanuc CNC rules, executing a machine reference return command (G28 or G30) automatically cancels any active tool length compensation vector. If the operator performs a manual or automatic reference return and fails to program an explicit G43 or G44 command upon resuming machining, the spindle will descend without tool length compensation, which can drive the turret or spindle directly into clamps, fixtures, or vise jaws.

Siemens

In native Siemens mode, G49 is not recognized. Instead, tool length offsets are managed via cutting edge selections (D codes) and canceled via D0. When toggled to ISO Dialect mode via G291, G49 operates as a modal Group 08 cancel code, governed by MD 20380. Changing planes mid-program without first canceling active offsets with D0 or G49 causes the control to compensate along the wrong axis, leading to severe path deviations.

In ISO Dialect mode, programmers call G49 ; or G49 Z100.0 H00 D0 to cancel length and radius offsets. In native SINUMERIK mode, the command is simply D0 ;.

  • MD 20380 $MC_TOOL_CORR_MODE_G43_G44: Determines how tool length offsets (G43/G44) are processed when external NC language mode is active (range: 1 to 2).
  • MD 10760 $MN_G53_TOOLCORR: Defines whether tool length and radius offsets are suppressed (set to 1) or retained (set to 0) during coordinate suppression G53, G153, or SUPA moves.
  • MD 18800 $MN_MM_EXTERN_LANGUAGE: Must be configured to 1 to compile external ISO NC language mode.
  • MD 20250 $MC_CUTCOM_MAX_BLOCKS: Restricts the preprocessor look-ahead buffer size to 3 consecutive non-movement blocks.
  • Alarm 61000: Technological standard cycles (POCKET3/POCKET4) called without active tool offset.
  • Alarm 61800: Executing ISO mode G291 with MD 18800 disabled.
  • Alarm 14011: G10.6 retract command without CYCLE3106.spf in memory.
  • Version Differences: Turning functions G51.2/G50.2 and advanced collision avoidance are exclusive to SINUMERIK 840D sl and omitted on SINUMERIK 802D sl.

Zero offset suppression commands (G53, G153, SUPA) will suppress tool length offsets depending on MD 10760. Ensure offsets are reloaded before calling technology cycles to prevent program aborts.

Mitsubishi

Mitsubishi controls execute tool length cancellation based on parameter No. 1268 (Bit 6), which switches between axis movement and coordinate shift types. Setup parameters like parameter No. 1210 control modal retention upon resetting. When coordinate shift type (No. 1268 = 1) is active, executing G49 alone performs no axis movement; instead, the program position counters are updated silently in the background, requiring an absolute travel command (G00 or G01) immediately after coordinate shift cancellation.

Cancellation is achieved via G49 ; or retraction blocks like G49 Z250.0 H00. The register value is set to zero using H0 or H00.

  • Parameter No. 1268 ext04/bit6: Offset operation type (0 = axis movement, 1 = coordinate shift).
  • Parameter No. 1210 RstGmd/bit7 & bit18: Controls whether G49 cancel mode is active (0) or if G43/G44 modals are retained (1) upon reset.
  • Parameter No. 1247 set19/bit0: Dictates if the axis physically moves when G49 is commanded alone. If 0, axis moves; if 1, no movement but counter cleared.
  • Parameter No. 1274 ext10/bit3: Selects H stand-alone command update mode.
  • Parameter No. 1292 ext28/bit3: Controls whether changes in offset values are executed in the next block (1) or immediately upon movement (0).
  • Parameter No. 1003 iunit: Selects active input unit system (B, C, D, or E) to define input command precision.
  • MCP Alarm Y51 108: Triggered if No. 1247, No. 1292, and No. 1274 are all simultaneously set to 1, disabling automatic operation.
  • Program Error (P70): G49 cancel command and a circular interpolation command (G02 or G03) programmed within the same block.
  • Program Error (P294): Coordinate shift type is active and G92 is executed during active tool offset.
  • Program Error (P170): Commanded tool length offset number exceeds the maximum sets configured.
  • Program Error (P29): G92.1 issued during active tool length compensation without designating the height axis, or G188/G189 format switch commanded before offset cancellation is complete.

If axis movement type is selected, commanding G49 alone forces the Z-axis to physically translate by the canceled offset value. Programming G49 near table-mounted clamps or fixtures can cause a catastrophic hard collision.

Brand Comparison

FeatureFanucSiemensMitsubishi
Native CancellationG49 or H0 cancels Group 08 offsets.No G49 in native mode; offsets are canceled via D0.G49 or H0 cancels Group 08 offsets.
Interpreter SwitchingNative parser handles ISO codes.Requires G291 to enable ISO Dialect mode; G290 switches to native.Native parser handles ISO codes.
Retraction & ResetG28/G30 automatically cancels offsets. Parameter TOS/TOP controls shift.MD 10760 defines suppression/retention on G53/G153/SUPA.G28/G30 temporarily cancels offsets. Parameter No. 1268 controls shift.
Bimodal FormattingNo bimodal format switches.Supported through bilingual compiler mode (G290/G291).Supports G44 as cancel code in M2/M0 format; checks completeness before G188/G189 format switch.

Technical Analysis of Brand Variations

Understanding the architectural differences between CNC controls reveals three distinct methods for tool length cancellation. First, Fanuc operates on a native, non-modal cancellation scheme during reference point returns (G28 or G30). This automatically cancels the active offset vector, whereas Siemens and Mitsubishi controls retain offset states depending on machine data parameter masks (such as Siemens MD 10760 or Mitsubishi parameter No. 1210). This variation requires programmers to know precisely how each control handles zero returns to prevent uncompensated spindle descents.

Second, Siemens utilizes a toggled bilingual compiler model (G290/G291) to reconcile G49 syntax. In native SINUMERIK mode (G290), G43, G44, and G49 are completely bypassed, and offset selection is managed entirely through tool edge registers (D codes), with D0 serving as the universal cancellation. ISO dialect mode (G291) must be activated to compile legacy ISO code. Fanuc and Mitsubishi controls interpret G49 natively within their main programming environments, although Mitsubishi provides additional flexibility by allowing G44 to act as a cancel command under its M2/M0 format option.

Third, Mitsubishi implements a strict parameter validation checker that enforces automatic operation lockouts via MCP Alarm Y51 108 if parameters for axis movement, offset change execution, and standalone H commands conflict. Fanuc and Siemens process these transitions via software alarms or compiler rules without disabling machine cycle starts at the PLC level. Programmers must ensure format switches (G188/G189) on Mitsubishi controls are only commanded after offset cancellations are fully complete to prevent compile-time faults.

Program Examples and Dry Run Walkthroughs

Fanuc G-Code Example

N10 G90 G00 G54 X100.0 Y100.0 ; Absolute positioning
N20 G43 Z50.0 H01 ; Activate length offset from H01, retracting to Z50.0
N30 G01 Z-10.0 F200 ; Perform machining pass
N40 G00 Z100.0 ; Retract to clearance
N50 G49 Z150.0 H00 D00 ; Cancel tool length (H00) and radius (D00) while retracting to Z150.0
N60 G91 G28 Z0 ; Perform machine zero return (automatic cancel backup)

Dry Run Walkthrough

  • Block N10: Moves the tool at rapid feed to target coordinates (X100.0, Y100.0) in the workpiece coordinate system.
  • Block N20: Reads the offset value from register H01, applies it in the positive direction along the Z-axis, and positions the tool at a safe height of Z50.0.
  • Block N30: Feeds the tool to Z-10.0 to execute the cut.
  • Block N40: Retracts the tool at rapid speed to Z100.0.
  • Block N50: Executes G49, canceling the active length offset and radius offset, and moves the physical Z-axis to Z150.0 with the compensation vectors removed.
  • Block N60: Returns the Z-axis to the machine zero position, resetting coordinates.

Siemens G-Code Example

N10 G291 ; Switch to ISO Dialect mode
N20 G90 G00 G54 X100.0 Y100.0 ; Absolute positioning
N30 G43 Z50.0 H01 ; Activate tool length compensation from H01
N40 G49 Z100.0 H00 D0 ; Cancel offsets and retract to Z100.0
N50 G290 ; Switch back to native Siemens mode
N60 T="CUTTER 4" D1 M06 ; Load native tool and cutting edge offset D1
N70 G00 Z150.0 ; Position with native offsets active
N80 D0 Z200.0 M05 ; Cancel all offsets and retract spindle

Dry Run Walkthrough

  • Block N10: Switches the preprocessor parser to ISO Dialect mode.
  • Block N20 & N30: Activate absolute positioning and load tool length compensation from register H01, positioning the Z-axis at Z50.0.
  • Block N40: Cancels both the tool length and tool radius offsets using G49, H00, and D0, retracting the axis to Z100.0.
  • Block N50: Toggles back to native Siemens mode.
  • Block N60: Loads a text-named tool and applies cutting edge offset D1.
  • Block N70: Positions the spindle using native Siemens multi-axis compensation values.
  • Block N80: Deactivates all tool offsets using D0 and retracts the spindle to machine Z200.0.

Mitsubishi G-Code Example

N10 G90 G00 G54 Z150.0 ; Rapid to absolute safe height
N20 G43 Z50.0 H01 ; Apply offset H01 and position at Z50.0
N30 G01 Z-15.0 F150 ; Machining feed to depth
N40 G00 Z150.0 ; Retract to clearance plane
N50 G49 Z250.0 H00 ; Cancel compensation and retract to Z250.0
N60 G91 G28 Z0.0 ; Reference position return

Dry Run Walkthrough

  • Block N10: Moves the Z-axis to a safe absolute clearance coordinate of Z150.0.
  • Block N20: Reads offset value H01, compensates the coordinates, and positions the tool tip at Z50.0.
  • Block N30: Feeds the tool to the cutting depth of Z-15.0.
  • Block N40: Returns the tool to the clearance plane at Z150.0.
  • Block N50: Executes G49, canceling the active offset vector, and moves the Z-axis to Z250.0 (compensating for the axis movement parameter setting).
  • Block N60: Performs a Z-axis reference return to establish physical machine zero.

Error and Alarm Analysis

Alarm CodeTrigger ConditionOperator SymptomRoot Cause & Resolution
Fanuc: Alarm PS0368Attempting to switch between G43/G44 length compensation and G43.7 tool position offset without first executing a G49 cancel block, or modifying Parameter 5040 (TCT) while offsets are active.The machine cycle halts immediately, displaying an "OFFSET REMAIN AT OFFSET COMMAND" message on the CRT screen.Program a G49 or H00 cancel block to clear all active offsets before switching offset types or modifying configuration parameters.
Fanuc: Alarm PS0325Programming a G49 cancel command within the finishing shape block range (defined from sequence start block P to end block Q) of a G70-G73 repetitive roughing cycle.The program execution aborts with "UNAVAILABLE COMMAND IS IN SHAPE PROGRAM" display.Remove all tool compensation cancel commands from the contour definition blocks; place G49 exclusively outside the P-to-Q block range.
Siemens: Alarm 61000Calling a technological standard cycle (such as circular pocket milling cycle POCKET4 or centering cycle CYCLE81) when there is no active tool offset or cutting edge compensation loaded.The NC controller halts processing and displays "No tool compensation active" on the user interface.Load a valid tool offset register (e.g. D1) in the NC block prior to calling the machining cycles.
Mitsubishi: Alarm Y51 108Parameters No. 1247 (set19/bit0), No. 1292 (ext28/bit3), and No. 1274 (ext10/bit3) are all set to 1 simultaneously.The control disables automatic cycle start, locking out the machine and displaying "MCP Alarm Y51 108".Resolve the parameter conflicts in the control settings. Ensure that axis movement, changed value execution, and H-register standalone update parameters are not conflicting.
Mitsubishi: Program Error P70Programming a G49 cancel command and a circular interpolation command (G02 or G03) in the same G-code block.The control rejects the block and displays a program error on the operator screen.Separate the G49 command and the circular arc movement command into distinct, consecutive blocks.

Application Note

Fracturing carbide tool inserts, bending the spindle axis, or shattering a solid carbide cutter occurs when a setup operator fails to execute G49 tool length compensation cancel at a safe clearance height before returning the spindle to the tool change position. If the machine parameters are configured for axis movement type, commanding G49 alone forces the Z-axis to physically translate by the active offset amount. If the spindle is positioned near table-mounted workpiece clamps, a fixture vise jaw, or a rotating chuck, this movement will cause a catastrophic physical collision. Programmers must ensure G49 is programmed only after retracting the tool to a safe Z-coordinate away from all physical obstructions.

Related Command Network

  • G43: Applies positive tool length compensation to shift the coordinate system.
  • G44: Applies negative tool length compensation based on the values stored in the offset registers.
  • D0: Serves as the global cutting edge offset cancel command in native Siemens controls, deactivating both length and radius offsets.
  • G28: Automatically cancels active tool length compensation vectors on Fanuc and Mitsubishi controls during reference return.
  • G188 / G189: Command format switches on Mitsubishi controls that require tool length offsets to be fully canceled before execution.
  • G47 Tool Offset Double Increase: Double increases travel distance by twice the offset register value. Link: g47-tool-offset-double-increase.
  • G46 Tool Offset Decrease: Decreases travel distance by the offset register value. Link: g46-tool-offset-decrease.
  • G48 Tool Offset Double Decrease: Double decreases travel distance by twice the offset register value. Link: g48-tool-offset-double-decrease.

Conclusion

Integrating G49 systematically at the end of every cutting sequence ensures predictable tool-change positioning and eliminates coordinate deviations. Validating parameter configurations—such as Fanuc No. 5006 or Mitsubishi No. 1268—guarantees that coordinate shift behaviors match the physical movements expected by the shop floor team. Prioritizing safe retract heights before canceling active compensation protects tooling, fixtures, and machine spindles from expensive collision damage.

Frequently Asked Questions

Can I use H0 instead of G49 to cancel tool length compensation?

Yes. Assigning H0 or H00 sets the active offset register value to zero, effectively canceling the compensation vector. However, using G49 is generally preferred for clarity on the shop floor, as it explicitly communicates the cancellation of the compensation mode to other operators and postprocessors.

Why does the Z-axis move physically when I command G49?

This physical movement occurs because the control parameter (such as Fanuc No. 5006 Bit 6 or Mitsubishi No. 1268 Bit 6) is configured for axis movement type. In this mode, canceling the offset causes the machine to translate the axis by the offset value to return the physical spindle face to the uncompensated coordinate value. Configure the parameter to coordinate shift type if you want the counter to update silently without physical motion.

What happens if I forget G49 before a tool change?

On many modern machines, the tool change macro (M06) will automatically trigger a tool length compensation cancel. However, if the macro does not include this step or if the machine is run in manual data input (MDI) mode, the previous tool's offset will remain active. When the new tool descends, the coordinate discrepancy can drive the tool turret or spindle directly into workpiece fixtures, causing a catastrophic hard crash.

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 - 2008)
  • Ö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