Table of Contents

Heidenhain Controller Support

Heidenhain programs run on a single controller preset that reads both dialects — TNC klartext (TNC 640 / TNC 530 conversational) and Heidenhain DIN/ISO. There is no separate selection to make: pick Heidenhain as the project's controller and the program is read in whichever dialect it is written in.

Coverage is stated in the same three states as General NC Code Support — supported, recognized but not simulated, and not supported. Recognized but not simulated is a deliberate state: the construct is consumed and reported under its own message id, so it can never be silently misread as something else. A PLANE AXIAL B+45 will never be mistaken for a rotary-axis command.

Program format

Separators are optional

Klartext is normally written with spaces between the letter instructions, and that is what the control shows. Some post-processors emit the same program with no separators at all. Both forms parse, and so does the detached feed spelling.

Equivalent, all parsed:

  • L X-26.3 Y+43.1 Z+100.3 A-90.0 C+13.123 FQ3 and LX-26.3Y+43.1Z+100.3A-90.0C+13.123FQ3
  • L X+0 Y+0 R0 FMAX and LX+0Y+0R0FMAX
  • FMAX M03 M08 and FMAXM03M08
  • F20000 and F 20000

Multi-line blocks

A statement broken across lines with the tilde continuation — the usual shape of a CYCL DEF body or a long PLANE statement — is joined back into one block before parsing, so it is read as the single statement it is.

Motion

Construct Support
L Straight-line motion with its axis words.
FMAX Rapid traverse.
CC / C Circular motion — CC sets the pole, C states the end point. DR- is clockwise and DR+ counter-clockwise, the centre may be left implicit, and an arc that closes on its start point is a full circle.
RL / RR / R0 Radius compensation left / right / off.
M91 One-shot machine-coordinate move for that block.
M126 / M127 Shortest-path rotary traverse on / off. With neither stated, shortest path is the default.
M140 MB+n / M140 MB MAX Tool-axis retract — by n mm, or to the positive Z stroke limit. Without a configured stroke limit, MB MAX reports M140--NoStrokeLimit and is skipped. The statement's own F drives the retract without entering the modal feedrate.
STOP Program stop, alongside M00 / M01.
CYCL DEF 32 TOLERANCE Path-smoothing tolerance.
BLK FORM Recorded as a stock declaration. It does not replace the workpiece configured in the project.

Tools

TOOL CALL performs the tool change on its own — klartext has no separate M06 trigger. A tool number or a quoted tool name is accepted.

Parsed:

  • TOOL CALL 1 Z S5000
  • TOOL CALL "1" Z S5000
  • TOOL CALL "B40R" Z S3000 DL+0.5
  • The spindle speed S is recorded modally.
  • DL is a length delta — the effective tool height is the tool-table height plus DL.
  • DR is read and recorded but not applied: radius compensation uses the tool-table radius as-is, and the block reports ToolChange--DeltaUnsupported.
  • A tool axis other than Z reports ToolChange--AxisUnsupported.
  • A TOOL CALL whose tool number could not be captured — an unevaluated variable, for example — reports ToolChange--MissingToolId.

Datums

CYCL DEF 247 sets the datum preset and CYCL DEF 7 is an additive shift on top of it, which is the TNC semantic. The two compose as separate entries in the coordinate chain instead of replacing each other.

Parsed:

CYCL DEF 247 Q339=+1
CYCL DEF 7.0 DATUM SHIFT
CYCL DEF 7.1 X10.123
CYCL DEF 7.2 Y22.223
CYCL DEF 7.3 Z32.97

Q parameters and FN

Q, QR, QL and QS parameters are read wherever a value is expected, so FQ1 reaches the feedrate, L X+Q2 reaches the program position and TOOL CALL SQ3 reaches the spindle speed. Q0Q99 free parameters and QR0QR499 permanent parameters are held as per-project data and saved with the project.

Construct Support
FN 0FN 5 Assignment and arithmetic, including the DIV keyword of FN 4 and the prefix SQRT of FN 5.
FN 9FN 12 Conditional jumps — executed, with a per-label iteration cap so a corrupt or hostile program cannot spin forever.
Other FN opcodes (FN 14, FN 16, FN 18 SYSREAD, …) Recognized, not simulated. The statement is claimed and reported, so its target parameter stays empty instead of taking a fabricated value.

Parsed:

  • Q1 = 5000
  • FN0: Q1 = 5000
  • FN1: Q1 = -Q2 + -5
  • FN2: Q1 = +10 - +5
  • FN3: Q2 = +3 * +3

Tilted planes and RTCP

Construct Support
PLANE SPATIAL Fully composed, including SEQ+ / SEQ-, COORD ROT / TABLE ROT, and the STAY / MOVE / TURN positioning behaviours.
PLANE RESET Cancels the tilt.
PLANE VECTOR Structurally captured, not simulated.
PLANE EULER / POINTS / RELATIV / AXIAL / PROJECTED Recognized, not simulated — consumed and reported as HeidenhainPlane--Unsupported, with the previous tilt retained.
FUNCTION TCPM Supported.
M128 / M129 Tool centre point control on / off — real RTCP, the Heidenhain sibling of ISO G43.4 and Siemens TRAORI.

Parsed:

  • PLANE SPATIAL SPA-60.3 SPB+0 SPC-19.88 STAY SEQ- TABLE ROT
  • PLANE RESET STAY

Cycles and calls

  • CYCL DEF 2xx bodies are read with their Q parameters mirrored into the block. Cycles 200, 232, 251, 252 and 253 are mapped onto the shared drilling machinery and simulated; the mapping follows the cycle's own Q values, so a Q202 peck increment routes to peck drilling and a Q211 bottom dwell to dwell drilling.
  • A CYCL DEF body that is not one of those is recognized, not simulated — reported as HeidenhainCycl--Unsupported.
  • CYCL CALL and CYCL CALL POS fire the cycle once; M99 fires once and M89 arms modal firing.
  • CALL LBL n inlines the label body up to LBL 0; CALL LBL n REP m repeats that section m times.
  • CALL PGM resolves the called program by file name.
  • Mirror image in both spellings — the klartext CYCL DEF 8 form and the DIN/ISO G28 form.

DIN/ISO dialect

The same preset, with nothing to switch.

  • % tape header and N block numbers.
  • T plus M06 tool change.
  • Arc centres I / J / K are absolute pole coordinates, not incremental offsets from the start point. This is the Heidenhain reading, and the pole carries forward modally.
  • The ISO label family — G98 L<n> definitions, and the head-anchored L<n>,<m> call whose comma count maps onto the repeat count.
  • G247 Q339 stamps the same datum preset as CYCL DEF 247.
  • G54 with axis words is read as a datum-shift declaration.
  • G70 / G71 units.
Warning

G28 on Heidenhain is MIRROR IMAGE, not a reference-point return. The Fanuc reading of G28 is deliberately absent from the Heidenhain preset. Select the Heidenhain controller for a Heidenhain DIN/ISO file — read as Fanuc, every mirror statement becomes a home move.

Not supported

TOOL DEF, FK free-contour programming, SL cycles, PATTERN DEF, and TCH PROBE. These are left unconsumed, and the block that carried them reports Parsing--Unconsumed naming the words.

Machine-specific M-codes that are not part of the Heidenhain vocabulary above are declared on the machine rather than built in — see the M-code note on General NC Code Support.

See also

  • General NC Code Support — Fanuc, Syntec, Mazak and Siemens SINUMERIK.
  • NC Parsing Engine — the pipeline behind these constructs, the brand-by-brand support matrix in one table, and how a machine's own vocabulary is added without changing HiNC.