Heidenhain TNC 640: Touch-Probe Cycles
The TNC 640 ships its probing as built-in TCH PROBE cycles — no Renishaw macro pack, no G65 argument lists. Workpiece probes (TS series, spindle-mounted) get cycles for alignment, presetting, and inspection in two generations: the classic 4xx set and the newer 14xx set, which adds tolerance parsing and semi-automatic setup. Tool probes (TT, table-mounted) get the 48x measurement cycles. Every cycle drops its results into fixed, globally effective Q parameters. This reference is verified against the TNC 640 measuring-cycles manual for NC software 34059x-18 — cycle inventories differ between Heidenhain series and firmware levels.
How TNC Probing Differs from Fanuc-Style G65 Macros
On a Fanuc or Haas you call vendor macros (G65 P9810 X.. Y..) with letter arguments and read #135-series results. On the TNC 640:
• Cycles are part of the control. Press the TOUCH PROBE key in Programming mode, pick the group, and the control walks you through a dialog with a help graphic highlighting each parameter.
• Parameters are named Q numbers, consistent across cycles: Q260 is always clearance height, Q261 measuring height, Q320 set-up clearance.
• Touch-probe cycles are DEF-active: they execute the moment the control reads the definition. There is no CYCL CALL and no M99 — a big difference from machining cycles and from G65 habits.
• Results land in fixed global Q parameters (Q150–Q199 for 4xx, Q950–Q997 for 14xx) and in an HTML log (TCHPRAUTO.html in automatic mode, TCHPRMAN.html for manual probing).
• The probe is a tool: it needs a tool-table row plus a matching row in the touch-probe table (both numbers must agree), and a TOOL CALL defining the probe axis must precede the cycle definition.
Behavior common to all cycles: the probe approaches paraxially (even under a basic rotation or tilted plane), stops at stylus deflection, stores the trigger point, and retracts at rapid. No trigger within the DIST distance from the touch-probe table → error message. Pre-positioning distance = ball radius + SET_UP (touch-probe table) + Q320 from the cycle; positioning logic pivots on Q260 CLEARANCE HEIGHT. Probing feed is column F, positioning feed FMAX, and F_PREPOS selects true rapid vs FMAX. TRACK = ON orients an infrared probe to the probing direction before each touch (recalibrate after changing it).
Manual Probing Functions
In Manual Operation and Electronic Handwheel modes the probing soft keys offer: probe calibration, a 3-D basic rotation via plane probing, a basic rotation via a line, preset on any axis, corner as preset, circle center as preset, centerline as preset, plus touch-probe data management. Measured values can be written straight to the preset table (or a datum table). Notes from the Setup manual: in Turning mode all manual functions work except Probe in plane and Intersection probing (X values read as diameters, and the probe must be calibrated separately for turning); with no probe inserted you can still capture actual position with NC Start. The machine parameter chkTiltingAxes decides whether the control verifies that rotary-axis positions match the active 3D-ROT angles when presetting — unset, it checks always.
Calibrating the Workpiece Probe (TS)
Calibration determines the effective stylus length (referenced to the tool reference point, usually the spindle nose) and effective ball radius; length/radius go to the tool table, center offset to columns CAL_OF1/CAL_OF2 of the touch-probe table. Recalibrate after commissioning, a broken or swapped stylus, a change of probing feed rate, thermal drift, or a change of active tool axis. Calibration values apply immediately — no new tool call needed. L-shaped styli (L-TYPE, supported by cycles 444 and 14xx) should be calibrated with 460 (radius) and 461 (length) at the same feed rate used for probing.
| Cycle | ISO | Calibrates |
|---|---|---|
460 CALIBRATION OF TS ON A SPHERE | G460 | Radius + center offset on a calibration sphere |
461 TS CALIBRATION OF TOOL LENGTH | G461 | Length against a surface of known height (Q434 preset for length) |
462 CALIBRATION OF A TS IN A RING | G462 | Radius + center offset in a ring gauge |
463 TS CALIBRATION ON STUD | G463 | Radius + center offset on a stud / calibration pin |
Workpiece Cycles I — Measuring Misalignment (Rotation)
Two generations coexist on this firmware. The 14xx cycles know the machine kinematics, accept nominal dimensions with tolerances (e.g. 10H7, 10+0.01-0.015), support 3-D calibration data, and can measure rotation and position simultaneously; compensation can go into the preset table as basic rotation or as a rotary-axis offset (Q1126 ALIGN ROTARY AXIS, Q1121 CONFIRM ROTATION).
| Cycle | Name | Measures misalignment from |
|---|---|---|
| 14xx generation | ||
1420 | PROBING IN PLANE | Three points on a plane (spatial angles SPA/SPB/SPC) |
1410 | PROBING ON EDGE | Two points on an edge |
1411 | PROBING TWO CIRCLES | Two holes or studs → line through the centers |
1412 | INCLINED EDGE PROBING | Two points on an inclined edge |
1416 | INTERSECTION PROBING | Intersection of two edges (2 points each) |
| Classic 4xx generation | ||
400 | BASIC ROTATION | Two points on a straight surface → basic rotation |
401 | ROT OF 2 HOLES | Two hole centers → basic rotation |
402 | ROT OF 2 STUDS | Two stud centers → basic rotation |
403 | ROT IN ROTARY AXIS | Two points → compensation by rotary-table rotation |
405 | ROT IN C AXIS | Angular offset between a hole center and +Y → C-axis rotation |
404 | SET BASIC ROTATION | Sets any basic rotation directly (no probing) |
Semi-automatic mode (14xx only)
If you don’t know where the part sits, program nominal positions as strings with a leading ? — the control stops, lets you jog the probe near the feature, and takes it from there. Manual example, edge alignment with unknown positions:
11 TCH PROBE 1410 PROBING ON EDGE ~
QS1100= "?" ;1ST POINT REF AXIS ~ ; unknown - jog to it
QS1101= "?0" ;1ST POINT MINOR AXIS ~ ; nominal 0, workpiece position unknown
QS1102= "?" ;1ST POINT TOOL AXIS ~
QS1103= "?" ;2ND POINT REF AXIS ~
QS1104= "?0" ;2ND POINT MINOR AXIS ~
QS1105= "?" ;2ND POINT TOOL AXIS ~
Q372=+2 ;PROBING DIRECTION ~ ; Y+
Q320=+0 ;SET-UP CLEARANCE ~
Q260=+100 ;CLEARANCE HEIGHT ~
Q1125=+2 ;CLEAR. HEIGHT MODE ~
Q309=+0 ;ERROR REACTION ~ ; 0 no stop, 1 stop on rework/scrap, 2 stop on scrap
Q1126=+0 ;ALIGN ROTARY AXIS ~
Q1120=+0 ;TRANSER POSITION ~
Q1121=+0 ;CONFIRM ROTATION
Workpiece Cycles II — Presetting
| Cycle | Sets the preset from | Cycle | Sets the preset from |
|---|---|---|---|
| 14xx generation | |||
1400 POSITION PROBING | A single point | 1401 CIRCLE PROBING | Hole or stud center |
1402 SPHERE PROBING | Sphere center | 1404 PROBE SLOT/RIDGE | Slot or ridge center |
1430 PROBE POSITION OF UNDERCUT | Position with L-stylus undercut access | 1434 PROBE SLOT/RIDGE UNDERCUT | Slot/ridge center in an undercut |
| Classic 408–419 generation | |||
408 SLOT CENTER PRESET | Slot center | 409 RIDGE CENTER PRESET | Ridge center |
410 PRESET INSIDE RECTAN | Rectangular pocket center | 411 PRESET OUTS. RECTAN | Rectangular stud center |
412 PRESET INSIDE CIRCLE | Hole center (4 touches) | 413 PRESET OUTS. CIRCLE | Stud center |
414 PRESET OUTS. CORNER | Outside corner | 415 PRESET INSIDE CORNER | Inside corner |
416 PRESET CIRCLE CENTER | Bolt-hole-circle center | 417 PRESET IN TS AXIS | One point in the probe axis (Z) |
418 PRESET FROM 4 HOLES | Intersection of lines through 4 holes | 419 PRESET IN ONE AXIS | One point in a selectable axis |
Where the calculated preset goes is controlled by Q303 (MEAS. VALUE TRANSFER) and Q305 (NUMBER IN TABLE) in every 4xx presetting cycle:
| Combination | Effect |
|---|---|
Q305=0, Q303=1 | Copies the active preset to row 0, corrects it, activates row 0 (simple transformations deleted) |
Q305≠0, Q303=0 | Writes to datum table row Q305 — activate later with TRANS DATUM (or Cycle 7) |
Q305≠0, Q303=1 | Writes to preset table row Q305 — activate with Cycle 247 |
Q303=-1 | Legacy programs from TNC 4xx / old iTNC 530 — the control refuses with an error; define Q303 explicitly |
Workpiece Cycles III — Inspection (Measuring)
The 42x cycles measure a feature, compare against nominal limits you define, optionally write a log (Q281: 0 none, 1 file, 2 screen/stop), optionally stop the program out of tolerance (Q309), and optionally correct the tool that cut the feature (Q330, see below).
| Cycle | Name | Measures |
|---|---|---|
0 / 1 | REF. PLANE / POLAR PRESET | Single position, paraxial / in a polar direction (legacy; HEIDENHAIN now points to 1400) |
420 | MEASURE ANGLE | Angle of a straight surface (2 points) |
421 | MEASURE HOLE | Hole center + diameter |
422 | MEAS. CIRCLE OUTSIDE | Stud center + diameter |
423 / 424 | MEAS. RECTAN. INSIDE / OUTS. | Rectangular pocket / stud: center + side lengths |
425 / 426 | MEASURE INSIDE WIDTH / RIDGE WIDTH | Slot width / ridge width |
427 | MEASURE COORDINATE | Any coordinate in a selectable axis |
430 | MEAS. BOLT HOLE CIRC | Bolt-circle center + diameter |
431 | MEASURE PLANE | Plane angle from 3 points |
| Special functions | ||
3 / 4 | MEASURING / MEASURING IN 3-D | Raw single-touch cycles (for macro writers; 4 probes along a vector) |
444 | PROBING IN 3-D | Single point against a 3-D nominal with tolerance band |
441 | FAST PROBING | Sets probe parameters (feed etc.) globally for subsequent cycles |
1493 | EXTRUSION PROBING | Repeats 14xx probing points along an extrusion direction |
| Kinematics (option 48) | ||
450–453 | SAVE / MEASURE KINEMATICS, PRESET COMPENSATION, KINEMATICS GRID | Rotary-axis kinematics measurement and compensation on a calibration sphere |
Tool monitoring (Q330): reference the milling tool by number or name and the control writes the measured deviation into that tool’s DR column — always, even inside tolerance — and checks it against RBREAK for breakage (tool locked, TL = L, program stops). Q181 tells your program whether rework is needed. For an indexed tool by name, the manual’s recipe: QS0 = "TOOL NAME", FN 18: SYSREAD Q0 = ID990 NR10 IDX0, add the index as a decimal (Q0 = Q0 + 0.2), then Q330 = Q0.
Tool Measurement with the TT (Cycles 480–485)
TT cycles measure stationary or rotating tools, or individual teeth, against a table-mounted tool probe. They require TOOL.T active and the tool called before measuring. First measurement writes geometry; wear values compare against LTOL/RTOL and breakage against LBREAK/RBREAK (tool locked at TL on violation). Speed and probing feed for rotating measurement are computed by the control from maxPeriphSpeedMeas and the measuring-tolerance machine parameters.
| Cycle (new / old) | ISO | Function |
|---|---|---|
480 / 30 CALIBRATE TT | G480 | Calibrate the tool touch probe (center offset found by a 180° spindle rotation of the calibration tool) |
481 / 31 CAL. TOOL LENGTH | G481 | Measure tool length |
482 / 32 CAL. TOOL RADIUS | G482 | Measure tool radius (rotating; individual-tooth check possible) |
483 / 33 MEASURE TOOL | G483 | Length and radius in one cycle |
484 CALIBRATE IR TT | G484 | Calibrate a (e.g. infrared) tool touch probe |
485 MEASURE LATHE TOOL | G485 | Turning tools (option 50 or 158) |
Cycles 31–33 and 481–483 are functionally identical; 481–483 exist as G481–G483 in ISO and always report status in the fixed parameter Q199 instead of a selectable one. Tool-table columns that feed the TT cycles: CUT (teeth), DIRECT (rotation direction), R-OFFS (radial offset for length measurement — default = tool radius), L-OFFS (axial offset for radius measurement). Manual guidance: drill → R-OFFS 0 (measure the tip); end mill → R-OFFS = R; 10 mm ball cutter → L-OFFS 5 so the diameter isn’t measured at the south pole.
Result Q-Parameters
| Parameter | Contents |
|---|---|
| Programmed probing during program run | |
Q115–Q119 | Spindle coordinates at the trigger point (X, Y, Z, 4th, 5th axis) — stylus length/radius NOT compensated |
| 4xx workpiece cycles — actual values | |
Q150 | Angle of a straight line |
Q151 / Q152 | Center in reference axis / minor axis |
Q153 | Diameter |
Q154 / Q155 | Pocket length / pocket width |
Q156 / Q157 | Length in the selected axis / position of the centerline |
Q158 / Q159 | Angle in the A axis / B axis |
Q160 | Coordinate in the selected axis |
| 4xx workpiece cycles — deviations & status | |
Q161–Q166 | Deviations: center ref axis, center minor axis, diameter, pocket length, pocket width, measured length |
Q167 | Deviation of the centerline position |
Q170–Q172 | Space angles found: rotation about A / B / C |
Q180 / Q181 / Q182 | Status flags = 1: good / rework / scrap |
| 14xx cycles | |
Q950–Q958 | Actual positions 1–3 in reference / minor / tool axis |
Q961–Q963 | Spatial angles SPA / SPB / SPC in the WPL-CS |
Q964 / Q965 | Rotation angle in the I-CS / in the rotary-table coordinate system |
Q966 / Q967 | First / second diameter |
Q980–Q988, Q994–Q997 | Deviations of the above (referenced to the mean tolerance) |
Q183 | Workpiece status: −1 not defined, 0 pass, 1 rework, 2 scrap |
| Tool measurement | |
Q115 / Q116 | Deviation of tool length / radius from nominal after automatic tool measurement |
Q199 | TT status: 0.0 within tolerance, 1.0 worn (LTOL/RTOL exceeded), 2.0 broken (LBREAK/RBREAK exceeded) |
Worked Example from the Manual — Measure & Rework a Stud
Rough a rectangular stud with allowance, measure it with Cycle 424, shrink the programmed side lengths by the measured deviations (Q164/Q165), and finish — the whole measure-and-correct loop in one program:
0 BEGIN PGM TOUCHPROBE MM
1 TOOL CALL 5 Z S6000 ; Tool call: roughing
2 Q1 = 81 ; Rectangle length in X (roughing dimension)
3 Q2 = 61 ; Rectangle length in Y (roughing dimension)
4 L Z+100 R0 FMAX M3
5 CALL LBL 1 ; Machine (subprogram)
6 L Z+100 R0 FMAX
7 TOOL CALL 600 Z ; Call the touch probe
8 TCH PROBE 424 MEAS. RECTAN. OUTS. ~
Q273=+50 ;CENTER IN 1ST AXIS ~
Q274=+50 ;CENTER IN 2ND AXIS ~
Q282=+80 ;FIRST SIDE LENGTH ~
Q283=+60 ;2ND SIDE LENGTH ~
Q261=-5 ;MEASURING HEIGHT ~
Q320=+0 ;SET-UP CLEARANCE ~
Q260=+30 ;CLEARANCE HEIGHT ~
Q301=+0 ;MOVE TO CLEARANCE ~
Q284=+0 ;MAX. LIMIT 1ST SIDE ~
Q285=+0 ;MIN. LIMIT 1ST SIDE ~
Q286=+0 ;MAX. LIMIT 2ND SIDE ~
Q287=+0 ;MIN. LIMIT 2ND SIDE ~
Q279=+0 ;TOLERANCE 1ST CENTER ~
Q280=+0 ;TOLERANCE 2ND CENTER ~
Q281=+0 ;MEASURING LOG ~
Q309=+0 ;PGM STOP TOLERANCE ~
Q330=+0 ;TOOL
9 Q1 = Q1 - Q164 ; Correct X length by measured deviation
10 Q2 = Q2 - Q165 ; Correct Y length by measured deviation
11 L Z+100 R0 FMAX
12 TOOL CALL 25 Z S8000 ; Tool call: finishing
13 L Z+100 R0 FMAX M3
14 CALL LBL 1 ; Machine again with corrected Q1/Q2
15 L Z+100 R0 FMAX
16 M30
17 LBL 1 ; Subprogram: CYCL DEF 256 RECTANGULAR STUD
18 CYCL DEF 256 RECTANGULAR STUD ~
Q218=+Q1 ;FIRST SIDE LENGTH ~
Q219=+Q2 ;2ND SIDE LENGTH ~
...
19 L X+50 Y+50 R0 FMAX M99
20 LBL 0
21 END PGM TOUCHPROBE MM
Common Gotchas
• Kill your transformations first. Cycles 400–499 must run with all coordinate-transformation cycles inactive (Cycle 7 DATUM SHIFT, 8 MIRRORING, 10 ROTATION, 11/26 SCALING). For 444 and 14xx the ban covers mirroring, scaling, and TRANS MIRROR. Collision warning straight from the manual.
• DEF-active means it runs now. The probe moves the instant the cycle definition is read — position safely before the TCH PROBE block.
• 4xx resets your basic rotation. Cycles 40x–43x reset an active basic rotation at cycle start.
• Q115–Q119 are raw. No stylus length or radius compensation — use the cycle result parameters (Q15x/Q95x) for real coordinates.
• Units follow the main program in logs and result parameters — but anything read via FN 18: SYSREAD is always metric.
• Tool number = probe number. The row number in the touch-probe table must match the probe’s tool number in TOOL.T, in manual and automatic modes alike.
• Q305=0 rewrites row 0. Presetting cycles with Q305=0/Q303=1 overwrite and activate preset row 0 — fine for setup, surprising mid-program.
• Calibrate like you probe. Same feed for calibration and probing, especially with L-shaped styli; recalibrate after changing TRACK or the probing feed.
• 14xx deviations reference the mean tolerance (Q98x/Q99x), not the nominal, whenever a toleranced dimension was programmed.
References
- HEIDENHAIN, TNC 640 Programming of Measuring Cycles for Workpieces and Tools User’s Manual, NC software 34059x-18, 10/2023, ID 1303409-23.
- HEIDENHAIN, TNC 640 Setup, Testing and Running NC Programs User’s Manual, NC software 34059x-18, 10/2023, ID 1261174-25 (manual probing functions, calibration in manual mode).
- HEIDENHAIN, TNC 640 Klartext Programming User’s Manual, 34059x-11, 01/2021, ID 892903-29 (preassigned Q-parameter reference).
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch