G57 Settable Zero Offset 4 Guide for Siemens SINUMERIK CNC
Learn how to program the G57 settable zero offset on Siemens SINUMERIK CNC controls. Avoid tool collisions and Alarm 18312 with MD 24000 settings.
Introduction
When an operator aborts a CNC program mid-cycle or resets the controller without clearing active coordinate registers, a Siemens SINUMERIK system retains the G57 zero offset in the background. If the operator subsequently executes a manual tool change on the turret or jogs the axes without clearing these active offset registers, resuming automatic cycle execution causes the tool turret to travel along an unretracted, shifted trajectory. Under these conditions, the spindle or turret drives the tool directly into a table-mounted fixture clamp, a workpiece vise jaw, or the rotating jaws of the spindle chuck. This catastrophic hard collision shatters the carbide cutting tool, bends the axis ball screws, triggers a drive overload alarm, and converts raw stock into a ruined scrap part. Setting the G57 zero offset correctly, verifying active registers, and utilizing electronic working area limitations are critical to preventing these expensive shop-floor crashes.
Technical Summary
| Technical Attribute | Specification |
|---|---|
| Command Code | G57 |
| Modal Group | Modal. Group 8 (Settable Work Offsets). |
| Supported Brands | Siemens (SINUMERIK series) |
| Critical Parameters | MD 28080 ($MC_MM_NUM_USER_FRAMES), MD 24000 ($MC_FRAME_ADD_COMPONENTS). |
| Main Constraint | Fine zero offsets require MD 24000 set to 1. Programmatic writing via G10 under ISO Dialect (G291) requires MD 18800 set to 1 and MD 20734 Bit 13 set to 1 to force a preprocessor stop. |
Quick Read
- Reference Shift: G57 shifts the active workpiece coordinate system from absolute machine zero (MCS) to a localized workpiece origin (WCS 4) to align toolpaths with part geometry.
- Bilingual Interpreter: Activating G57 via external ISO G10 commands requires switching the compiler to G291 mode, while native SINUMERIK frames must be executed under G290.
- Fine Offset Setup: Operators must set MD 24000 ($MC_FRAME_ADD_COMPONENTS) to 1 to enable fine offset summation, preventing Alarm 18312 during additive shifts.
- Preprocessor Sync: Writing offsets programmatically in ISO Dialect mode requires setting MD 20734 Bit 13 to 1 to execute an automatic preprocessor stop (STPPRE) for immediate run-block synchronization.
- Collision Shielding: Setup operators should use G25/G26 programmable working area limitations (WALIMON) to define active exclusion zones that protect spindle components.
- Reset Defaults: Configure MD 20150 $MC_GCODE_RESET_VALUES[7] to G500 to automatically clear settable zero offsets on power-on or NC reset.
Basic Concepts
Practical programming of the G57 zero offset on Siemens controls shifts the program coordinate system origin from the machine's absolute zero point (MCS) directly to a localized workpiece zero (WCS), allowing programmers to evaluate toolpaths relative to the part geometry. The actual distance between the machine zero and the workpiece zero depends entirely on the workpiece type and how it is physically clamped. In turning applications, this zero offset is typically entered to compensate for the tightening clearance of the chuck. For machining center applications, G57 is adjusted to define the physical distance from machine zero to the workpiece zero point located directly on a fixture clamp or vise jaw. Symmetrical contours or multiple setups can be machined dynamically by establishing independent coordinate origins. For example, three identical workpieces arranged on a pallet can be machined successively according to the zero offsets G54, G55, and G56 (or G57), while executing a single subprogram (such as L47), drastically reducing program size.
Every individual user zero offset (G54 to G599) consists of a coarse offset and a fine offset, and the coarse and fine offsets are mathematically added together to determine the active workpiece zero. Setup operators and programmers must maintain absolute vigilance regarding coordinate offset registration and active boundaries during program execution. If an operator performs a manual zero preset, moves the axis manually during an active shift, or executes a reset with incomplete axis arguments, the remaining axes will retain their shifted values. If a program is aborted mid-cycle or reset before a G57 offset cancellation has been executed, the offset remains active in the background. If the operator performs a tool change on the turret or moves the axes without clearing the active offset registers, resuming automatic cycle execution can cause the tool turret to travel along an unretracted path. Under these conditions, the spindle or turret can drive the tool directly into a table-mounted fixture clamp, a workpiece vise jaw, or the rotating jaws of the chuck, resulting in a catastrophic hard collision.
Command Structure
The G57 command is a modal preparatory function that establishes the fourth user-settable zero offset frame. Once selected, all absolute positioning coordinates (G90) are evaluated relative to the G57 coordinate origin. G57 remains active in control memory until another work offset command replaces it, or a system reset clears the active registers.
In native Siemens mode (G290), G57 is called directly as a standalone instruction or within a motion block. Under ISO Dialect mode (G291), coordinates are written to the G57 offset registers using G10 data input blocks. This allows program-driven coordinate updates during automated cycles.
; Native SINUMERIK Mode: G57 ; G90 G57 G00 X__ Y__ Z__ D__ ;
; ISO Dialect Mode: G291 ; G10 L2 P4 X__ Y__ Z__ ; G290 ;
| Address / Symbol | Role in Command | Application Context |
|---|---|---|
| X, Y, Z | Absolute position target coordinates. | Specifies target destinations evaluated from the active G57 zero point. |
| D | Cutting edge offset number. | Selects active tool compensation (D1 to D12, D0 to cancel compensation). |
| G10 | Programmable data input. | Instructs the NC processor to write data to work offset registers. |
| L2 | Workpiece offset data input group. | Specifies standard work coordinate offsets in G10 blocks. |
| P4 | Coordinate register selection code. | P4 selects the G57 work offset register in ISO Dialect mode. |
Brand Applications
Siemens
The Siemens controller manages G57 as a dynamic user frame managed in memory. The system allocates work offsets using machine data MD 28080 ($MC_MM_NUM_USER_FRAMES). Activating the compiler interpreter for external ISO code is controlled via MD 18800 ($MN_MM_EXTERN_LANGUAGE).
A typical G-code block for activating this offset in native Siemens mode: G57 G17 G90 G00 X100.0 Y50.0 Z10.0 T1 D1. In this block, the control shifts the active coordinate system to G57, selects the XY plane (G17), activates tool edge compensation (D1), and rapid positions the axis.
- MD 28080 $MC_MM_NUM_USER_FRAMES: Configures the total number of user-settable offsets allocated in control memory (standard G54 to G57, and extended G505 to G599).
- MD 24000 $MC_FRAME_ADD_COMPONENTS: Enables fine zero offset components when set to 1. If configured to 0, writing fine offsets triggers Alarm 18312.
- MD 20734 $MC_EXTERN_FUNCTION_MASK (Bit 13): Forces an internal preprocessor stop (STPPRE) during G10 write commands to ensure instant synchronization.
- Alarm 18312: Fine offset not configured. Occurs when attempting to write additive fine offsets (G59) while MD 24000 is disabled.
- Alarm 14800: Programmed path velocity is less than or equal to zero. Occurs if feed movement is programmed after G57 without an active F rate.
- Alarm 61800: External CNC system missing. Triggered if switching to G291 ISO Dialect mode while MD 18800 is disabled.
- Version Differences: SINUMERIK 840D sl supports widescreen multi-touch panels with minimized standard windows and advanced collision avoidance options, whereas compact 802D sl controls have locked geometry parameters (such as MD 10604) and restrict custom side-screen options.
Warning: Running legacy ISO code with separate block skip levels / and /1 can result in unexpected axis movement if they are not activated independently in the Siemens settings.
Brand Comparison
Because the brand filter restricts this article to Siemens SINUMERIK systems, this section compares the configuration and capabilities of the G57 zero offset across different Siemens SINUMERIK control series. Selecting the right control series determines how zero offsets, parameter settings, and crash-avoidance systems behave on the shop floor.
| Control Series | Offset Architecture | Safety & Crash Prevention | Parameter & Customization Access |
|---|---|---|---|
| SINUMERIK 840D sl | Dynamic, modular frame stack with support for coarse, fine, and chained transformation components. | Supports full multi-channel "Collision Avoidance" software options and widescreen multi-touch screens. | All machine data (including geometry axis change mode MD 10604) is unlocked and configurable. |
| SINUMERIK 828D | Standard frame stack supporting standard G54 to G57 and up to 99 extended offsets (G505 to G599). | Basic axis limit monitoring and software limit switches, but no advanced multi-channel collision avoidance. | Parameters are accessible via standard keyswitches (Protection levels 2/7), with pre-configured channel limits. |
| SINUMERIK 802D sl / Compact | Basic zero offset memory with fixed register allocations and limited extended offset arrays. | Standard hardware limit switches; does not support dynamic collision avoidance options. | Crucial machine data parameters (such as MD 10604) are locked and cannot be changed by the operator. |
Technical Analysis
The architectural behavior of zero offset handling on Siemens controls relies on a dynamic, modular "frame" memory stack. Rather than storing zero offsets as rigid, absolute coordinate registers, Siemens treats G57 as a baseline settable frame. On top of this baseline G57 frame, programmers can dynamically chain programmable absolute offsets (TRANS, ROT, SCALE, MIRROR) or additive modifiers (ATRANS, AROT, ASCALE, AMIRROR) within the same program block. These frames can be suppressed globally or selectively using multi-level suppression commands (G53, G153, SUPA, or G500) depending on active parameters. This provides significantly greater programming flexibility compared to traditional absolute coordinate systems.
Siemens also operates on a bilingual toggled compiler model. The controller requires the programmer to explicitly switch the compiler to ISO Dialect mode via G291 to compile blocks containing legacy ISO styles, such as G10 offset inputs or G57 selections. The program must then command G290 to switch back to native SINUMERIK mode to process advanced parametric frames and native zero offsets. Additionally, Siemens maps legacy block skip levels as separate, independent channels. Unlike standard ISO interpreters where the / and /1 skip characters represent the exact same level, Siemens treats / and /1 as separate skip levels that must be activated independently. If an operator runs a legacy program containing both skip styles on a Siemens control without separately configuring these skip levels, blocks designed to be skipped may execute, resulting in unexpected axis travel and catastrophic workpiece collisions.
Program Examples
Siemens G-Code Example
; Siemens: G290 ; Switch compiler to native Siemens SINUMERIK mode
; Siemens: G57 G17 G90 G00 X100.0 Y50.0 Z10.0 T1 D1 ; Selects G57 coordinate offset, select XY plane, absolute rapid positioning
; Siemens: TRANS X15.0 Y10.0 ; Set absolute programmable zero offset frame relative to active G57 WCS
; Siemens: G291 ; Switch compiler to ISO Dialect mode to parse legacy blocks
; Siemens: G10 L2 P4 X-300.0 Y-150.0 Z-50.0 ; ISO Dialect: Programmably writes coordinates into G57 (P4) offset registers
; Siemens: G290 ; Return to native Siemens mode
; Siemens: G00 Z200.0 M5 ; Rapid Z-axis retraction
dry run
During a dry run, the programmer steps through the NC blocks. First, G290 switches the compiler to native Siemens SINUMERIK mode. Next, the control selects the G57 settable zero offset, establishes the XY plane (G17), activates tool compensation (T1 D1), and rapid traverses the spindle to absolute coordinates X100.0, Y50.0, and Z10.0 relative to the G57 origin. Then, the absolute programmable offset TRANS X15.0 Y10.0 executes, shifting the program origin by X+15.0 and Y+10.0 relative to G57. The G291 command then toggles the compiler to ISO Dialect mode. While in ISO mode, the G10 L2 P4 block writes the new offset values (X-300.0, Y-150.0, Z-50.0) directly into the G57 (P4) offset registers without generating immediate tool path movement. Finally, the compiler returns to native mode (G290) and retracts the Z-axis safely to Z200.0.
Error Analysis
When programming zero offsets on Siemens SINUMERIK controls, specific parameter conflicts or syntax errors can halt the machine. The following table lists common alarms, their causes, and how to resolve them on the shop floor.
| Alarm Code | Trigger Condition | Operator Symptom | Root Cause / Fix |
|---|---|---|---|
| Siemens Alarm 18312 | Program attempts to write or execute an axial zero offset via G59 (additive fine offset) with G57 when MD 24000 is 0. | Control halts execution, displays "Fine offset not configured", cycle start turns red. | Configure machine data parameter MD 24000 ($MC_FRAME_ADD_COMPONENTS) to 1 and perform a NCK reset to enable fine offset summation. |
| Siemens Alarm 14800 | A linear feed movement (G01) is executed following G57 selection but path feedrate F is 0 or has not been programmed. | Axis motion halts instantly, showing a zero feedrate warning on the panel. | Program an active feedrate F value in or before the motion block, or verify that the "Fixed feedrates" function is active. |
| Siemens Alarm 61800 | Compiler attempts to switch to ISO Dialect mode (G291) or compile G10/G57 commands while MD 18800 is disabled. | Interpreter halts program execution, displaying "External CNC system missing". | Enable the external NC language interpreter by setting machine data MD 18800 ($MN_MM_EXTERN_LANGUAGE) to 1. |
| Siemens Alarm 12080 | Compiler parses unrecognized commands, formatting conflicts, or native commands under G291 when MD 20734 Bit 3 is 0. | Execution stops, alarm banner displays "Syntax error" pointing to the conflicting block. | Correct command syntax for dialect-specific formatting, or adjust scanner error handling in MD 20734 Bit 3. |
Application Note
Tool turret and spindle crashes occur when operators resume automatic cycle execution after a manual axis jog or reset without clearing the active zero offset registers. When the Siemens SINUMERIK control retains the baseline G57 frame in the background, a tool change or subsequent positioning block will command the turret along an unretracted path. The resulting hard collision drives the carbide tool directly into a table-mounted fixture clamp, workpiece vise jaw, or the rotating jaws of the chuck, shattering the cutting tool and bending the axis ball screws. To prevent this severe damage, configure the working area limits using G25/G26 parameters to establish digital exclusion zones that automatically halt the axis feed before contact is made.
Related Command Network
- G54 to G56 / G505 to G599: Standard settable zero offsets (1 to 99) representing the baseline workpiece coordinate system frames.
- G500: Deactivates all active settable work offsets (G54 to G599) and restores the default zero frame.
- TRANS / ATRANS: Programmable absolute and additive zero offset translation frames that shift the coordinate origin dynamically relative to the active G57 zero offset.
- G53 / G153 / SUPA: Non-modal frame suppression commands that bypass active zero offset registers for absolute machine coordinate positioning.
- G290 / G291: Compiler mode switches that toggle the controller between native SINUMERIK programming and external ISO Dialect mode.
Conclusion
Safe zero offset management on Siemens controls requires rigorous coordination between machine data settings, compiler modes, and active suppression states. CNC programmers must explicitly verify active frames before executing tool changes, ensuring all temporary shifts are neutralized using standalone TRANS or G500 commands to prevent catastrophic axis collisions.
FAQ
How do I resolve Alarm 18312 when programming fine offsets with G57?
Set the machine data parameter MD 24000 ($MC_FRAME_ADD_COMPONENTS) to 1 in the control interface, perform a NCK reset, and verify that the coarse and fine offset summation is correctly calculated before executing G59 blocks. This enables the fine offset component required for additive frame adjustments.
Why does writing G10 in native Siemens mode cause Alarm 12080?
G10 is an ISO Dialect specific command that cannot be parsed under native SINUMERIK mode (G290). To write offset values programmatically, insert a G291 compiler switch block prior to G10, and execute G290 immediately afterward to restore Siemens programming mode.
How can I prevent G57 offsets from remaining active after pressing reset?
Configure the reset behavior parameter MD 20150 $MC_GCODE_RESET_VALUES[7] to G500. This automatically deactivates all active settable zero offsets and returns the controller to the basic zero-frame on reset, preventing silent coordinate frame carry-overs.
Still not resolved?
Ask our AI assistant about this topic in natural language. Grounded in verified sources, no hallucinations.

- 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
G71 Metric Dimensioning Guide for Siemens SINUMERIK Controls
Learn how to program G71 and G710 metric dimensioning on Siemens SINUMERIK controls, including parameter MD 10240, alarm codes, and G-code syntax errors.
G69 Balance Cut Cancel: Coordinate Recovery & Crash Prevention
Learn how to program the G69 balance cut cancel command for Fanuc, Siemens, and Mitsubishi turning centers. Cancel dual slide synchronization and prevent crashes.
G70 CNC Finishing Cycle Guide for Fanuc, Siemens, and Mitsubishi
Learn the G70 finishing cycle for CNC turning. Master syntax, parameters, and alarm codes for Fanuc, Siemens CYCLE95, and Mitsubishi controls to avoid crashes.
G69 Coordinate System Rotation Cancel: Modals, Alarms, and Setup
Learn to cancel G68 facing turret mirrors and coordinate rotations using G69 on Fanuc, Siemens, and Mitsubishi CNCs to prevent turret crashes.