Skip to main content
CNC.wikiCNC.wiki

G10 and G11: In-Program Offset and Parameter Modification Guide

Learn G10 and G11 for Fanuc, Siemens, and Mitsubishi CNC. Avoid errors, stack coordinates safely, check parameters, and prevent spindle collisions.

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

CNC CARE Co-founder

Introduction: The Cost of Dynamic Motion and Parameter Overwrites

An improperly managed tool offset shift during automatic machining can instantly drive a tool spindle at rapid speed directly into a chuck, vise jaw, or metal clamp. In high-speed production environments, an un-synchronized incremental wear compensation stack in a repeating macro loop causes the toolpath to creep progressively deeper on every cycle pass. Instead of a controlled tool transition, the operator sees a blinding flash of sparks, followed by a violent grinding sound and a catastrophic hard collision that destroys the spindle shaft and turns a high-tolerance aerospace part into a scrap part. This physical destruction highlights the necessity of absolute control when utilizing programmatic data inputs.

G10 and G11 Technical Summary

FeatureSpecification
Command CodeG10 (Data setting start), G11 (Data setting cancel)
Modal GroupNon-modal
Compatible BrandsFanuc, Siemens, Mitsubishi
Critical Parameter LimitsFanuc Parameter No. 5014, Siemens MD20734 Bit 1 & Bit 13, Mitsubishi Parameter #1241 set13/bit0
Core Safety RequirementCommand G10 and G11 in independent blocks; avoid compounding with movement, canned cycles, or compensation commands

Quick Read: Best Practices for In-Program Modifications

  • Execute G10 and G11 parameter-setting blocks as completely isolated commands on their own program lines to prevent timing errors.
  • Track absolute G90 versus incremental G91 active states before executing G10 to avoid compounding compensations into infinite loops.
  • Enforce preprocessing synchronization using Siemens MD20734 Bit 13 or explicit STOPRE blocks to align LookAhead paths with dynamic shifts.
  • Limit incremental wear compensation increments using safety limits like Fanuc Parameter No. 5014 to abort out-of-range toolpaths.
  • Discard legacy commands like G10 L50 on modern systems like the Mitsubishi M8V Series, enforcing modern G10 L70 configurations.
  • Verify motor insulation via megohmmeter measurements on U, V, and W wires when recovering from electrical faults like alarm SV0438.
  • Perform a complete dry run without tools or raw workpieces mounted whenever modifying core parameters programmatically.

Basic Concepts of G10 and G11

The programmable data input functionality of G10 and G11 allows CNC programmers to dynamically alter workpiece coordinates, tool offsets, and machine parameters during program execution. This enables advanced automation, coordinate system shifting, dynamic wear adjustment, and torque/current control without operator intervention.

Dynamic in-program modification requires absolute synchronization between the CNC preprocessor and the execution path to prevent spatial errors, mechanical overtravels, and scrap parts. Without this synchronization, the lookahead buffer (LookAhead) on modern CNCs will execute movement blocks with pre-shift coordinates while updating the variables asynchronously, leading to off-dimension cutting and collisions.

Command Structure and Parameter Syntax

The syntax of G10 is defined by the command code G10, which opens the programmable data input bus, and is cancelled by G11. Programmers specify the type of system modification via the L address. The precise memory index or offset register to modify is targeted by the P address, while the X, Y, Z, R, or other dimensional values are written through respective coordinate addresses.

Leaving G10 open without a corresponding G11 is a dangerous programming failure. Subsequence lines are read as raw values intended for the data setting bus rather than executable coordinates. Isolating G11 on an independent block ensures the NC interpreter returns to normal modal motion parsing.

The basic command syntax for different machine configurations and offsets is mapped below:

  • Fanuc Milling: G10 L10/L11/L12/L13 P_ R_ (L10/L11 for tool geometry/wear length, L12/L13 for tool geometry/wear radius)
  • Fanuc Lathe: G10 P_ X_ Z_ R_ Q_ (P > 10000 targets geometry, P < 10000 targets wear)
  • Siemens ISO: G10 L2 Pp X_ Y_ Z_ (P targets active work offset systems G54 to G59)
  • Mitsubishi: G10 L70 P_ S_ A_ D_ (targets parameter registers directly via system, axis, and numeric address structure)
AddressFunctionNotes
LData Setting TypeSelects workpiece coordinate offsets (L2/L20), tool offsets (L10-L13), parameter input (L50/L52/L70), or current limits (L14).
POffset/Parameter NumberDetermines the specific register to modify.
ROffset ValueSpecifies the geometric or wear compensation value (often absolute or incremental).
SPart System NumberUsed in Mitsubishi parameter modifications to target system 1 or system 2.
AAxis NumberDesignates the physical axis index for parameter or coordinate updates.
DNumeric Parameter ValueNumeric input value for system parameter changes.
HBit Data ValueBinary status flag (bit-level data) for Mitsubishi system parameter writes.
QTool Tip Orientation / EdgeSpecifies tool nose tip direction (1 to 9) in lathe settings.

Brand-Specific G10/G11 Applications

Fanuc Applications

Fanuc controls separate tool offsets into geometry and wear categories, using specific L-codes on Machining Centers and direct numerical offsets on Lathes. The wear limit is governed by Parameter No. 5014 to prevent operators from entering excessive offsets, while Parameter No. 11502 controls G10-based parameter writes that necessitate a complete system reboot.

Example: G10 L10 P10001 X10.0 Z5.0 R2.0 ;

  • Parameter No. 5014: Caps the maximum allowable wear compensation input. Valid range is 0 to 999999 (millimeter input in IS-B) or 0 to 9999999 (IS-C).
  • Parameter No. 11502 Bit 2 (WPP): Determines if programmable parameter input via G10 is allowed for options requiring reboot (0: Disabled, 1: Enabled).
  • Alarm 031: ILLEGAL P COMMAND IN G10, triggered if P is out of range or L lacks corresponding options.
  • Alarm 032: ILLEGAL OFFSET VALUE IN G10, occurs if wear compensation exceeds the limit in Parameter No. 5014.
  • Alarm 1144: G10 FORMAT ERROR, thrown when essential setting addresses are omitted.
  • Version Difference (M vs. T Series): Machining Centers use L10/L11 (H geometry/wear) and L12/L13 (D geometry/wear). Lathes combine these under combined P-indices where geometry is P = 10000 + n and wear is P = n.
  • Version Difference (Legacy vs. Modern): Legacy 0-C systems use diagnostic parameters 800-803 for tracking position deviation, whereas modern controls like 30i-B and 0i-F use unified diagnostic register 300, requiring Alpha i-B amplifiers.

Do not run a program loop with G91 G10 incremental wear modifications without an active limit variable, as the offset will stack indefinitely, leading to a tool plunge into a chuck or vise jaw, causing an expensive mechanical crash.

Siemens Applications

Siemens SINUMERIK controls run ISO G-code via a translation layer, mapping standard G10 statements directly into native variables. This mapping is highly configurable, with machine data MD20734 Bit 1 determining the threshold for separating tool geometry from wear, and Bit 13 controlling internal preprocessing stops.

Example: G10 L2 P1 X10 Y10 Z0 ;

  • Machine Data MD20734 Bit 1: Splits geometry and wear thresholds. If set to 0, P < 100 is geometry and P > 100 is wear. If set to 1, P < 10000 is geometry and P > 10000 is wear.
  • Machine Data MD20734 Bit 13: Forces an automatic preprocessing stop (STOPRE) during G10 execution (0: Disabled, 1: Enabled).
  • Machine Data MD18601: Limits the maximum global user frames available for extended coordinate offsets.
  • Alarm 12550: Triggered if G10 attempts to write to a non-existent tool cutting edge (such as Flat D-number index failures).
  • Alarm 14182: Thrown when mismatching H or D addresses are commanded in ISO dialect mode (offsets 1-98 allowed; H99 triggers alarm).
  • Version Difference (ISO Dialect Mode): Switch between native Siemens mode (G290) and ISO mode (G291). Offset addressing relies on flat D-number structures and $MN_EXTERN_TOOLPROG_MODE (Bit 2).

Avoid disabling the preprocessing stop (setting MD20734 Bit 13 to 0) without manually adding STOPRE blocks, as LookAhead calculation will execute toolpath movements using stale or incorrect coordinate shifts.

Mitsubishi Applications

Mitsubishi controls enforce strict block isolation for parameter tuning and data setting, utilizing L70 for direct memory mapping and L14 for torque control. Safety features lock core system files, and parameter #1241 set13/bit0 controls errors related to conflicting unmodal and modal G-codes in the same block.

Example: G10 L70 P8007 S1 A1 D30 ;

  • Parameter #1241 set13/bit0: Selects error state for illegal unmodal and modal code combinations (0: Alarm P45 occurs, 1: Error avoided, modal code ignored).
  • Parameter #1274 ext10/bit5: Selects G54 coordinate handling (0: Standard, 1: G54 Pn treated as G54.1 Pn).
  • Parameter #2214 SV014: Sets servo current limit percentage during dynamic L14 current limit sequences (Valid range: 1% to 999%).
  • Parameter #1100 Tmove: Delays tool compensation execution to the next block when T is commanded in the same block as G10 (0: Delayed, 1: Standard).
  • Alarm P421 / P422: Thrown if G10 L70, G10 L100, or G11 are not isolated in independent blocks.
  • Alarm P33: Triggered by coordinate offset coding mismatches or programming sequence numbers between G10 L3 and G11.
  • Alarm P35: Thrown when setting values exceed their allowable ranges (such as L14 torque greater than 999%).
  • Alarm P45: Occurs when G10 is run inside cutter compensation (G41/G42) blocks while parameter #1241 set13/bit0 is 0.
  • Version Difference (M vs. L System): The Machining Center M system isolates tool parameters via L10-L13, whereas the Lathe L system relies on L10/L11 with axis labels. Modern M8V controls omit the legacy G10 L50 parameter format entirely, demanding L70 syntax.

Do not program G10 or G11 in blocks containing fixed cycles or subprogram calls, as this corrupts the internal interpolator timing, throwing P421 timing faults and causing dangerous axis movements.

Cross-Brand Architecture Comparison

TopicFanucSiemensMitsubishi
Modes & Modal SeparationParameters modified via modal blocks started with G10 L52/L50 and ended with G11.ISO commands mapped onto Siemens variables; seamless transitioning between Siemens (G290) and ISO (G291).Start (G10 L70/L100) and cancel (G11) commands must be isolated as entirely independent blocks.
Tool Offset ManagementStrict separate L-codes for geometry/wear in M-Series; combined P-addresses (P = 10000 + offset) in T-Series.Configurable geometry/wear split threshold using MD20734 Bit 1 (split at 100 or 10000).Rigid separation of formats between M system (L10-L13) and L system (L10/L11 with axis codes).
Preprocessing & TrajectoryDirectly updates registers based on incremental or absolute motion modal states.Can execute G10 with internal STOPRE stop via MD20734 Bit 13 to prevent pre-processing path corruption.Compounding G10 with cycles or subprogram calls corrupts the internal interpolator timing.
Parameter Lockout / SecurityRigidly blocks parameter modifications to safety configurations (e.g. Dual Check Safety) unless parameter 3226 is unlocked.Deeply integrated backend variables mapping ($P_UIFR) allowing programmatic frame access.Hard-locks PLC switches, device/SRAM open parameters, and PLC axis parameters from being rewritten via program.

In-Depth Technical Analysis

The mathematical execution of G10 depends entirely on the CNC's system variable backend. In Fanuc controls, G10 acts as a direct register write, immediately modifying tool offset values or system parameter tables based on absolute or incremental movement modes. However, because Fanuc writes these changes in real-time, the programmer must explicitly manage subprogram loop structures to prevent cumulative offset additions that could drive the tool into vise jaws. Fanuc protects core safety setups by locking G10 parameter writes to safety structures, such as Dual Check Safety, until Parameter 3226 is unlocked.

Siemens handles the ISO-standard G10 command differently by utilizing a transparent mapping layer. Instead of writing directly to machine register tables, the Sinumerik controller translates G10 L2 or L20 calls into native backend variables like $P_UIFR (user coordinate frames) and $TC_DP (tool parameters). This permits smooth, parallel command structures where both ISO-dialect (G291) and native Siemens (G290) codes coexist. Beyond this, the preprocessor synchronization in Siemens is superior: configuring MD20734 Bit 13 automatically injects a STOPRE preprocessing stop, preventing the controller's lookahead logic from executing subsequent blocks using old offset coordinates.

Mitsubishi stands apart by requiring rigid execution isolation and utilizing highly granular address structures. Unlike Fanuc and Siemens, which permit inline parameters and commands, Mitsubishi requires that G10 L70 parameter start, shape input (G10 L100), and G11 cancel commands occupy their own independent blocks. Any violation immediately triggers a P421 or P422 program error. Mitsubishi protects core system integrity by physically hard-locking critical system settings—such as PLC switches, SRAM open parameters, and device parameters—from any modification via program, preventing macro loops from corrupting the ladder logic. Addresses are targeted directly with hierarchical labels, requiring S_ for part systems, A_ for axis numbers, and D_ or H_ for values, rather than relying on obscure system variable numbers.

Practical Program Examples

Fanuc Example

G10 L52 ;
N1000 P1 R10 ;
G11 ;
G10 L10 P10001 X10.0 Z5.0 R2.0 ;

dry run: When this code block is executed, the preprocessor first encounters G10 L52, which initiates the parameter input mode. It then reads block N1000, setting parameter number 1000 for the first axis to a value of 10. The non-modal G11 command terminates the parameter input sequence. Finally, G10 L10 writes an absolute X geometry offset of 10.0, Z offset of 5.0, and radius R of 2.0 to offset number 10001.

Siemens Example

G291 ;
G10 L2 P1 X10 Y10 Z0 ;
G10 P16 X32.5 W0.05 ;
G11 ;
G290 ;

dry run: The controller starts by executing G291 to transition the Siemens interpreter into ISO Dialect mode. Next, the G10 L2 P1 block shifts the standard G54 coordinate system to X10 and Y10. The subsequent G10 P16 block applies an incremental Z-axis (W0.05) wear adjustment of 0.05 mm on tool cutting edge 16. The G11 cancels parameter entry, and G290 restores native Sinumerik command interpretation.

Mitsubishi Example

G10 L70 P8007 S1 A1 D30 ;
G11 ;
G91 G10 L10 P10 R-500. ;
G90 G10 L2 P1 X100.0 Z50.0 ;
G10 L14 X50 ;

dry run: The Mitsubishi control processes G10 L70 in an isolated block to start parameter injection, updating parameter 8007 for system 1, axis 1, to a value of 30. G11 terminates the parameter mode. The control then changes to incremental mode (G91) to apply a -0.5 mm wear offset to tool index 10 via G10 L10. Next, it switches back to absolute mode (G90) to reset the G54 coordinate system (P1) to X100.0 and Z50.0. Lastly, G10 L14 X50 sets a 50% current limit on the X-axis servo to enable a safe workpiece stopper push sequence.

Error and Alarm Analysis

BrandAlarm CodeTrigger ConditionOperator SymptomRoot Cause / Fix
Fanuc031Offset number following address P is excessive or omitted, or L-code lacks corresponding options.The machine stops mid-execution, displays P/S alarm 031, and halts automatic cycle.Correct the P or L value to ensure they correspond to available tool offset registers or active options.
Fanuc032Wear compensation amount set by G10 exceeds the maximum limit specified in parameter 5014.Spindle motion ceases, and P/S alarm 032 appears on the screen.Adjust the G10 wear offset value to fit within Parameter No. 5014 limits, or modify parameter 5014.
Fanuc1144Essential data setting addresses like P or R are missing, or unsupported addresses are present.The control halts execution with G10 format error alarm 1144.Reformat the G10 block to include all required parameters and remove illegal addresses.
SiemensAlarm 12550G10 attempts to write to a non-existent tool cutting edge or index.Execution halts with Alarm 12550, and the spindle stops spinning.Define the tool cutting edge index inside the Flat D-number structure before running the G10 block.
SiemensAlarm 14182Write command uses an impermissible offset index in ISO dialect mode (e.g., offsets 1-98 allowed; H99 used).The machine displays Alarm 14182 and halts motion.Limit ISO-mode tool offset addresses to the 1-98 range, or execute native Siemens G290 code.
MitsubishiP421 / P422G10 L70, G10 L100, or G11 are programmed in blocks containing motion or subprograms.The controller locks up and throws a P421/P422 parameter input error.Ensure all G10 parameter changes and G11 cancel commands are on completely independent lines.
MitsubishiP33G10 is commanded in the same block as G54-G59, or registration data L3/L30 has sequence numbers.Program error P33 is indicated, stopping the automatic cycle.Write workpiece coordinate modifications in isolated blocks and remove sequence numbers (N-codes) between G10 L3 and G11.
MitsubishiP35Commanded value exceeds maximum limits, such as a G10 L14 axis current limit set beyond 999%.The machine halts with program error P35.Keep value parameters within limits (current limitation ratio must be between 1% and 999%).
MitsubishiP45G10 is executed in the same block as cutter compensation (G40, G41, G42) while parameter #1241 is 0.The control throws incorrect G-code combination alarm P45.Program G10 outside radius compensation blocks, or set parameter #1241 set13/bit0 to 1.

Advanced Application Note

In dynamic manufacturing setups, letting a volatile servo amplifier fault go unchecked will result in complete system failure. If an operator ignores fluid pooling around a physical connector, cutting fluid or coolant will eventually permeate the sealed motor housing, destroying the insulation resistance of the internal windings and triggering a phase-to-ground short circuit. This electrical breakdown registers as a devastating SV0438 or SV0414 servo deviation alarm, causing an immediate emergency stop mid-cut. Technicians must never simply hit reset to clear the fault; doing so will send high current into a damaged circuit and destroy the replacement amplifier. Instead, technicians must physically disconnect the power lines from the amplifier terminals and use a megohmmeter to test the insulation resistance of the physical U, V, and W wires.

To resolve complex tracking issues, modern Fanuc systems integrate a diagnostic function known as Smart Troubleshooting directly into the CNC interface. This system actively latches exact motor status data at the millisecond of a failure and displays a graphical flowchart asking the operator "YES/NO" questions to trace the fault down to a specific cable, connector, or parameter. In addition, Fanuc systems embed a highly granular software diagnostic matrix that breaks down generic servo faults into specific bit-level flags on diagnostic parameter DGN 200 (such as OVL, LV, OVC, and HCA flags), allowing technicians to instantly isolate whether a fault is a lack of physical response, overheating, or electrically corrupted data. Finally, Fanuc utilizes a proprietary high-speed fiber-optic bus (fssb-fiber-optic-troubleshooting) to daisy-chain all servo amplifiers together. If a communication fault occurs, system alarms explicitly identify the exact physical cable segment that failed between two specific amplifier nodes, visually mapping the broken link for the technician. Testing these physical connections and verifying signal pathways is standard practice in advanced CNC diagnostic environments, as detailed in cable-connector-communication-faults and cnc-servo-motor-failure-diagnostics.

Related Command Network

  • G90 / G91: These modal commands dictate whether coordinate settings written by G10 will overwrite the registers absolutely (G90) or accumulate additively (G91).
  • G54 to G59: These coordinate commands represent the primary workpiece coordinate system registers targeted and updated via G10 L2 parameter adjustments.
  • G290 / G291: These Siemens-specific codes enable switching between Siemens native variable mode (G290) and ISO Dialect mode (G291), where traditional G10 syntax is parsed.
  • STOPRE: This preprocessing stop command is utilized in Siemens programs to pause the lookahead preprocessor, ensuring dynamic G10 offsets are synchronized with actual axis movements.
  • G37: This Mitsubishi automatic tool length measurement command provides physical feedback that verifies programmatic offset changes made by G10 L10 wear modifications.

Strategic Conclusion

Successful in-program offset and parameter modification relies on strict block isolation, meticulous preprocessing synchronization, and robust software wear boundaries. CNC programmers must enforce isolated lines for all G10 data setting and G11 cancel commands, utilize internal preprocessor stops like STOPRE to synchronize lookahead timing, and lock down wear registers using parameters such as Parameter No. 5014 to prevent catastrophic tool plunges. Applying these rigorous, brand-specific standards is the only way to safeguard expensive machine spindles, prevent hard crashes into workholding, and maintain dimensional tolerance in high-speed automated production.

Frequently Asked Questions

Why does a G10 command cause a preprocessing timing error in Siemens controls?

Siemens controllers read multiple blocks ahead using LookAhead logic to compute optimal acceleration paths. When a G10 coordinate shift is commanded without a synchronization barrier, the preprocessor modifies variables in the background while axes are still traversing in old space, causing mismatched dimensions or spindle crashes. Practical Action: Set machine data MD20734 Bit 13 to 1 to force an automatic internal STOPRE preprocessor stop, or program a manual STOPRE block immediately following the G10 line to serialize execution.

What is the physical consequence of omitting a G11 command after G10?

Leaving the G10 data input mode open causes the CNC interpreter to parse all subsequent program lines as system variables or offset parameters rather than executable movement commands. This state triggers severe formatting alarms (such as Fanuc alarm 1144 or Mitsubishi P421), halts production instantly, and can write garbage data into unrelated parameter tables if coordinate lines resemble parameter syntax. Practical Action: Program the G11 cancellation command as a dedicated, isolated block immediately after the data input lines, and verify its presence before running automatic cycles.

How can parameter 5014 prevent mechanical crashes during incremental offset wear updates?

If an incremental wear compensation loop (G91 G10) is programmed inside a repeating macro without an escape condition, the tool offset will add onto itself indefinitely. Setting a maximum allowable value in Fanuc Parameter No. 5014 establishes a physical guardrail; if a G10 block attempts to apply an incremental wear shift exceeding this threshold, the control instantly throws a P/S 032 alarm and halts spindle motion. Practical Action: Verify that Parameter No. 5014 is set to a reasonable maximum (such as 0.5 mm) on all machining centers to halt runaway macro loops before a tool plunges into a vise jaw.

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