Overview
G291 switches the SINUMERIK control into ISO dialect mode, allowing it to interpret programs written in Haas- or Fanuc-style G-code without converting them to native Siemens syntax
When active, ISO mode:
- Accepts only ISO dialect G/M codes; Siemens-specific G/M codes cannot be used.
- Retains the currently active tool, tool compensation, and work offsets when switching between G290 and G291.
- Prevents mixing Siemens and ISO commands in the same program block.
- May automatically switch to Siemens mode during certain calls (see Subprograms & Macros section).
For complete syntax rules, function limits, and safety guidance, consult the manuals listed in the References section before running in production.
How to Use G291
To enter ISO dialect mode:
- G291 ; Enable ISO dialect NC programming language
To return to native Siemens mode:
- G290 ; Enable Siemens NC programming language
Rules:
- G290 and G291 must be the only command in their program block.
- Switching modes does not clear the active tool or offsets.
- Mode switching is per channel, one channel can run in ISO while another remains in Siemens mode.
Tool Calls and Offsets
In G291 ISO mode, the control accepts Haas-style tool commands, but you must specify both the tool (T) and the length/diameter offset (D) to have the correct values applied from the tool table.
ISO Mode Tool Change Syntax
T1 M6 ; Changes tool to Tool 1, no offset applied T1 D1 M6 ; Changes tool to Tool 1 and applies Length/Radius Offset 1
Important:
- The T and D values must exist in the tool table for the offset to be applied.
- If only T is specified (e.g., `T1 M6`), the tool changes but no length/diameter offset is active.
Native Mode Tool Call (G290)
In G290 native Siemens mode, use `TOOLCALL`:
TOOLCALL 1 D1 ; Calls Tool 1, applies Length/Radius Offset 1
Notes:
- `TOOLCALL` cannot be used in ISO mode (G291). Attempting to do so will result in a syntax error.
- Tool changes in Siemens native mode apply offsets automatically if specified in the `TOOLCALL` line.
- Always confirm the correct offset is active in the tool table before machining.
| Mode | Syntax Example | Description |
|---|---|---|
| G291 ISO | `T1 M6` | Changes tool only, no offset applied. |
| G291 ISO | `T1 D1 M6` | Changes tool and applies offset D1 from the tool table. |
| G290 Native | `TOOLCALL 1 D1` | Calls Tool 1 and applies offset D1. Not valid in ISO mode. |
Work Offsets
Work coordinate offsets define the machine position of the workpiece zero. In ISO mode (G291), SINUMERIK interprets standard G54–G59 offsets the same way Haas or Fanuc-based controls do.
Supported Offsets in ISO Mode
- G54 to G59 — Standard work offsets (same as Haas/Fanuc)
- G505 to G599 — Extended work offsets (if enabled by machine data)
- G500 — Resets all applied offsets (returns to machine coordinate system)
G291 ; Enter ISO Mode G54 ; Use Work Offset 1 T1 D1 M6 ; Load tool and offset G0 X0 Y0 ; Move to work zero
SUPA – Native Siemens Offset Suppression
SUPA – Suppresses all offsets (tool, work, and measurement).
Not available in ISO mode — use G500 instead.
Note: `SUPA` is not supported in G291 ISO mode. Use `G500` to reset the work offset instead.
Offset Setup Tips
- Always define offsets in the Zero Offset table before use.
- ISO programs start with the active work offset from the previous program unless changed.
- Use G500 before setting a new G54–G59 if you require a clean state.
Compatibility Notes
| Command | Description |
|---|---|
| G54–G59 | Standard ISO work offsets supported in both Haas and SINUMERIK G291 mode |
| G505–G599 | Extended offsets available if enabled via machine data (MD20010) |
| G500 | Resets the current work offset (returns to machine coordinates) |
| SUPA | Suppresses all offsets — only valid in G290 native Siemens mode |
Best Practices
- Always include an explicit `G54` (or G55/G56...) call early in your ISO program, do not assume it's carried from the previous program.
- Avoid using `SUPA` in G291. Use `G500` to clear work offset and return to machine coordinates.
- When switching between Siemens native and ISO modes, reapply the appropriate offset (e.g., `G54` in ISO, or `G54` + `TOOLCALL` in native).
Cycles
In G291 ISO mode, the control accepts standard Haas canned cycles (G81–G89, G73, etc.) directly and interprets them using ISO shell cycles. You do not need to rewrite them unless you are converting the program to run in native Siemens mode (G290).
When using G290, Haas cycles must be rewritten to the equivalent Siemens `CYCLE..` format. Siemens cycles are functionally similar but require parameters inside parentheses, separated by commas.
Example conversion to native Siemens:
Haas: G83 Z-1.0 R0.1 Q0.2 F5.0 Siemens: CYCLE83(1.0, 0.1, 0.0, 0.2, 5.0)
| Haas Code | Function | Haas Example | Siemens Native (G290) Equivalent |
|---|---|---|---|
| G81 | Standard drilling | `G81 Z-1.0 R0.1 F5.0` | `CYCLE81(1.0, 0.1, 0.0, 5.0)` |
| G82 | Drilling with dwell | `G82 Z-1.0 R0.1 P1.0 F5.0` | `CYCLE82(1.0, 0.1, 0.0, 5.0, 1.0)` |
| G83 | Peck (deep hole) drilling | `G83 Z-1.0 R0.1 Q0.2 F5.0` | `CYCLE83(1.0, 0.1, 0.0, 0.2, 5.0)` |
| G84 | Right-hand tapping | `G84 Z-1.0 R0.1 F1.25` | `CYCLE84(1.0, 0.1, 0.0, 1.25)` |
| G74 | Left-hand tapping | `G74 Z-1.0 R0.1 F1.25` | `CYCLE84(1.0, 0.1, 0.0, 1.25) + M4` |
| G85 | Boring (no dwell) | `G85 Z-1.0 R0.1 F0.5` | `CYCLE85(1.0, 0.1, 0.0, 0.5)` |
| G86 | Boring with spindle stop | `G86 Z-1.0 R0.1 F0.5` | `CYCLE86(1.0, 0.1, 0.0, 0.5)` |
| G89 | Boring with dwell | `G89 Z-1.0 R0.1 P1.0 F0.5` | `CYCLE89(1.0, 0.1, 0.0, 1.0, 0.5)` |
| G76 | Fine boring / threading | `G76 Z-1.0 R0.1 F0.5` | `CYCLE95(1.0, 0.1, 0.0, 0.5, 1.0)` or PROC logic |
| G73 | Chip-breaking peck drill | `G73 Z-1.0 Q0.1 R0.1 F5.0` | Use subprograms or PROC logic to emulate |
Notes
- In G291, run Haas cycles as-is.
- In G290, rewrite to the `CYCLE..` format.
- For left-hand tapping in native mode, include `M4`.
- G73 has no direct Siemens cycle and must be emulated with a subprogram or PROC.
Macros and Variables
Haas-Style Macros
Haas uses custom macros to handle logic, loops, and variables. These typically rely on:
- `#` variables (e.g., `#101 = 5.0`)
- Macro calls using `G65`
- Conditional logic (e.g., `IF`, `GOTO`)
- Local/Global variable scopes
Example (Haas):
#101 = 5.0 G65 P9001 A#101 IF [#101 GT 10] GOTO 100
SINUMERIK Equivalent
Siemens handles logic using structured programming with:
- `R` variables (e.g., `R1 = 5.0`)
- Subprogram calls using `LBL`, `CALL`, or `PROC`
- `IF`, `WHILE`, `GOTO`, `ENDWHILE` logic blocks
- Local vs Global variable declarations
Example (Siemens):
R1 = 5.0 CALL LBL1 IF (R1 > 10) GOTO LBL100 ENDIF
Note: Siemens macros do not work while `G291` ISO mode is active. `G291` is for standard G-code interpretation only. To use macro logic, you must switch back to native Siemens mode with `G290`.
Subprogram Call Comparison
| Haas | Siemens Equivalent |
|---|---|
| M98 P9001 | CALL LBL1 or CALL PROCNAME |
| G65 P9010 A#101 B#102 | Use CALL with parameters assigned to R variables |
Best Practices
- Avoid placing macro logic inside `G291` sections.
- Use `TOOLCALL`, `CYCLE`, and native Siemens logic outside `G291` for full compatibility.
- Rebuild Haas macros using Siemens `PROC` subprograms if needed.
Tool Compensation
Cutter Compensation
| Concept | Haas (ISO) | Siemens (G291 ISO Mode) |
|---|---|---|
| Cutter Comp Left | G41 D01 | G41 D1 |
| Cutter Comp Right | G42 D02 | G42 D2 |
| Cancel Compensation | G40 | G40 |
| Required Moves | Linear lead-in/out required | Linear lead-in/out required |
| Comments | D selects diameter offset from table | D must match an entry in SINUMERIK tool table |
Length Compensation
| Concept | Haas (ISO) | Siemens (G291 ISO Mode) |
|---|---|---|
| Assign Length Offset | H01 | H1 |
| Tool Change Format | T1 M06 H01 | T1 D1 M6 H1 *(if required)* |
| Comment | H = Tool length offset | H is recognized in ISO mode; use D for diameter |
Best Practices
| Best Practices & Notes |
|---|
| Always verify that tool numbers and D/H offsets are set correctly in the SINUMERIK tool table. |
| If cutter comp behaves incorrectly, check for missing lead-in/lead-out moves or incorrect offset numbers. |
| Use full `T1 D1 M6` format for reliable tool length and diameter loading in G291 mode. |
| TOOLCALL and other advanced tool functions are only available in native Siemens mode (G290). |
Haas Probing on SINUMERIK
Haas probing G-codes (WIPS) are thin wrappers around macros that drive a probe using skip motion (G31), then write results into work offsets. On SINUMERIK you can:
• Stay in G291 (ISO) and program raw probing with G31, then write offsets with G10.
• Switch to G290 (native) and call Siemens measurement cycles / MEAS instructions to do the same job with guided masks.
General Pattern (Why/How)
• G31 (skip) in ISO works the same conceptually: feed until probe triggers, stop at hit.
• In G291, write offsets programmatically (G10 write).
• In G290, use Siemens measurement cycles / MEAS / MEASA / MEAW; they handle trigger & offset writes.
Safe header for any raw probing block
G90 ; absolute G94 ; feed per minute G21 (or G20) ; units match program F500 ; safe probing feed (e.g., 500 mm/min or 20 ipm)
Haas → SINUMERIK mapping (probing)
| Haas Code | Purpose | In G291 (ISO): Raw approach with G31 + G10 | In G290 (Native): Siemens approach |
|---|---|---|---|
| G31 | Skip until probe trigger (basic probing motion) | G94 F500 G31 X#<_target> ; stop on hit, position latched ; compute offset, then: G10 L2 P1 X#<_wcs_x> Y#<_wcs_y> Z#<_wcs_z> | Use MEAS/MEASA/MEAW or a measurement cycle that performs a single-axis touch and writes to the selected work offset. |
| G166 (single surface) | Find a single face location and update WCS | (single X-face example) G94 F500 G31 X[#<_approach>] ; approach toward face ; math → X0 at hit ± stylus radius G10 L2 P1 X#<_newX> ; write G54 X | Call the single-surface measurement cycle (or MEAS instruction) in X/Y/Z and enable “write to active offset/WCS”. The cycle handles the trigger and offset write. |
| G167 (corner) | Find intersection of two faces (X/Y corner) and set WCS | (two touches) G94 F500 G31 X[#<_approachX>] G31 Y[#<_approachY>] ; math → corner coords G10 L2 P1 X#<_newX> Y#<_newY> | Use the corner / two-surface measurement cycle to probe X then Y and write X/Y of the chosen WCS automatically. |
| G165 (bore/boss) | Find center & size of a hole or boss | (4 touches @ 0/90/180/270) G94 F500 G31 X+... ; +X touch G31 X-... ; -X touch G31 Y+... ; +Y touch G31 Y-... ; -Y touch ; math → center & diameter G10 L2 P1 X#<_cx> Y#<_cy> | Call the bore/boss measurement cycle; set type (internal/external), approach radius, and target WCS. The cycle returns center and size and can update WCS. |
| G169 (web/pocket) | Measure width and centerline of a web/pocket | (two parallel faces) G94 F500 G31 X+... G31 X-... ; math → width & midline ; optionally update offset: G10 L2 P1 X#<_centerX> | Use the web/pocket cycle to probe the two faces and report width and midline; enable writing the midline into the desired WCS axis if required. |
| G170–G174 (tool probe) | Tool length/diameter on OTS setter | (example: length touch) G94 F200 G31 Z-... ; descend to setter, stop on trigger ; compute/meas length → write to tool table | Use the machine’s tool measurement cycle (length/diameter). These natively update the tool table entries without manual math. |
Notes
• Commissioning: G31 requires the probe’s skip input to be mapped in the PLC. If a G31 move never “hits,” that’s a wiring/commissioning issue.
• Units & feed mode: Force G94 for consistent F behavior (especially on lathes that often run G95).
• Offset writes in ISO: G10 write syntax follows the ISO dialect (e.g., `G10 L2 P<offset> X.. Y.. Z..` for G54..G59). Confirm dialect & axis sign per your setup.
• Mode swaps: If you switch to G290 to use Siemens cycles, keep G290 and G291 on their own lines. Re-assert any needed frames/offsets after swapping.
• Operator control: Using G1 for approach lets the operator scale speed with feed-override (useful on first-article runs).
• Safety: Start with generous clearance planes and conservative feeds; verify probe calibration before writing any WCS or tool data.
Quick “Slow-rapid” Replacement (for Haas G291 lines)
If your incoming Haas code uses G291 for half-rapid, replace it with a short, scoped feed block:
(HAAS G291 → Siemens-safe slow approach) G94 F500 G1 ; ... sensitive moves only ... G0
Videos
YouTube: ISO compatibility mode with G291 in Turning
Mr. CNC covers running ISO-based G-code (RS-274) on SINUMERIK using G291 — including enabling/disabling ISO mode (G291/G290), tool call formats for lathes and mills, subprogram handling, mixing DIN/ShopTurn/ISO code, differences on 808D, and key limitations such as loss of certain Siemens functions.
References
SINUMERIK 840D sl / 828D / 802D sl – ISO Dialects, Function Manual
- Edition: 07/2022 Order No.: A5E52211448 B AA
- Covers: ISO G-code interpretation (e.g., G291/G290, G/M codes, cycles, tool offsets in ISO mode).
SINUMERIK ONE – NC Programming Manual
- Edition: 03/2025 Order No.: A5E48054250B AK
- Covers: Native SINUMERIK programming (e.g., TOOLCALL, work offsets G54–G599, G500, SUPA, cutter compensation, structured programming, PROC, G290).
SINUMERIK 840D sl / 840D / 840Di sl / 840Di / 810D – Cycles Programming Manual
- Edition: 04/2006, Order No. 6FC5398-3BP10-0BA0
- Covers: Full breakdown of CYCLE81 through CYCLE959, including syntax, parameters, and usage examples for drilling, milling, and turning.
0 Comments