Heidenhain TNC 640 Training 9: Mill-Turning, Turning Mode and 800-Series Cycles

12 November 2026

Mentor CNC Editorial Team

Part 9 of the Heidenhain TNC 640 training series explains turning on mill-turn machines from the operator’s side: which keys switch to turning mode, how speed and feed rate are defined, how the turning tool table is opened and corrected, how unbalance is measured and what the 800-series turning cycles look like in a program. This page applies only to TNC 640 machines with the turning option (option 50). The information is taken from the Heidenhain TNC 640 user’s manuals.

How does mill-turning work on the Heidenhain TNC 640?

Heidenhain TNC 640 mill-turn machine axes and rotary table
Mill-turn machine: the rotary table turns like a lathe spindle while the milling spindle holds the turning tool still.
TopicIn turning mode
What rotatesThe workpiece rotates. The rotary table serves as the lathe spindle; the milling spindle with the tool is fixed
CoordinatesX describes the diameter of the workpiece, Z the longitudinal position. Programming is always in the XZ plane
Workpiece zeroThe preset must be in the center of the lathe spindle (rotary table)
Position displayDiameter values are shown for the X axis, with an additional diameter symbol
Speed potentiometerThe spindle potentiometer acts on the lathe spindle (rotary table)
SimulationTurning can be simulated only in the Test Run mode (option 20 and a workpiece blank suitable for turning are required)

Which machine axes are used depends on the machine kinematics and is defined by the machine tool builder.

How do you switch to turning mode? (FUNCTION MODE TURN)

StepWhat to doWhat you see
1In the Programming mode, go to the block after which the line should be inserted–
2Press the SPEC FCT keyThe soft-key row with special functions appears
3Press the TURNING PROGRAM FUNCTIONS soft keyThe turning functions appear
4Press the BASIC FUNCTIONS soft key–
5Press the FUNCTION MODE soft key–
6Press the TURN or MILL soft keyThe line FUNCTION MODE TURN or FUNCTION MODE MILL is written into the program
7If the builder has enabled kinematics selection: enter a quotation mark and press SELECT KINEMATICSThe kinematics name is added, e.g. FUNCTION MODE TURN "AC_TABLE"

While turning mode is active, a symbol is shown in the status display; in milling mode there is no symbol. When switching, the control runs a macro prepared by the machine tool builder that makes the machine-specific settings.

Point to noteWhat the manual says
Tool positionThe tool tip must be oriented to the center of the lathe spindle; position the Y coordinate to the center of the lathe spindle
Outside and inside machiningFor outside machining the tool tip points to the center, for inside machining away from the center
Direction of rotationAfter a tool change, check that the direction of rotation of the lathe spindle is correct
Switching not possibleThe mode cannot be switched while Tilt Working Plane or TCPM is active
Coordinate transformationsIn turning mode no coordinate transformations are permitted except the datum shift
ClampingHeavy workpieces at high speed create large forces; make sure the workpiece is securely clamped

How is the speed defined for turning? (FUNCTION TURNDATA SPIN)

StepWhat to doWhat you see
1Press the SPEC FCT keyThe special functions row appears
2Press the TURNING PROGRAM FUNCTIONS soft key–
3Press the FUNCTION TURNDATA soft key–
4Press the TURNDATA SPIN soft key–
5Use the VCONST: soft key to switch constant cutting speed on or off and enter the valuesThe line is written into the program
EntryMeaning
VCONST:ONConstant cutting speed. The control raises the speed as the tool moves toward the center and lowers it as the tool moves away
VCONST:OFFConstant spindle speed, independent of the tool position
VCCutting speed (optional)
SNominal speed when constant cutting speed is not active (optional)
S MAXMaximum speed with constant cutting speed (optional). Reset with S MAX 0
GEARRANGEGear range for the lathe spindle (optional)
Program lineWhat it does
FUNCTION TURNDATA SPIN VCONST:ON VC:100 GEARRANGE:2Constant cutting speed 100 in gear range 2
FUNCTION TURNDATA SPIN VCONST:OFF S550Constant spindle speed 550

When the maximum speed is reached, the status display shows SMAX instead of S. With constant cutting speed the selected gear range limits the possible speed range; the gear ranges depend on the machine.

How is the feed rate given in mm per revolution? (M136)

Program lineWhat it means
15 L Z-10 F200Without M136 the F value is interpreted in mm/min: 200 mm/min
19 M136From here on feed rates are interpreted in mm per revolution
20 L X+154 F0.2Feed rate 0.2 mm per revolution
M137Cancels M136; the feed rate is in mm/min again

With feed per revolution the control moves the tool by the entered value for each spindle revolution, so the contouring feed rate rises with the speed. Feed rates inside turning cycles follow the same rule: mm/rev if M136 is programmed, otherwise mm/min. Check whether M136 is active before you change an F value.

How do you open and fill in the turning tool table? (TOOLTURN.TRN)

Heidenhain TNC 640 turning tool table toolturn.trn with ZL and XL columns
Turning tool table: tool number, name, lengths ZL and XL, compensation DZL and DXL.
StepWhat to doWhat you see
1Select a machine operating mode, e.g. Manual Operation–
2Press the TOOL TABLE soft keyThe tool table (TOOL.T) opens
3Press the TURNING TOOLS soft keyThe turning tool table (toolturn.trn) opens
4Set the EDIT soft key to ONValues can be changed; below the table the control shows the dialog text, unit and input range of the selected field

Two tables work together: A turning tool must also be marked in the tool table TOOL.T by selecting the tool type TURN in the TYP column. The tool number in TOOLTURN.TRN must match the number in TOOL.T. Geometry values such as L and R from TOOL.T are not effective with turning tools.

Heidenhain turning tool geometry TO ZL XL RS T-ANGLE P-ANGLE
Turning tool data: lengths ZL and XL, tip radius RS, setting angle T-ANGLE, point angle P-ANGLE, tool orientation TO.
ColumnMeaning
TTool number; must match the number in TOOL.T
NAMETool name; taken over automatically from the tool table
ZLTool length 1 (Z direction)
XLTool length 2 (X direction)
YLTool length 3 (Y direction)
DZL / DXL / DYLDelta values (wear); added to ZL, XL and YL
RSTool tip radius; considered in turning cycles and for contours with RL/RR compensation
TOTool orientation (direction of the tool tip), 1 to 9
ORISpindle orientation angle of the milling spindle for aligning the turning tool to the machining position
T-ANGLESetting angle for roughing and finishing tools
P-ANGLEPoint angle for roughing and finishing tools
CUTLENGTH / CUTWIDTHCutting length and width of the recessing tool
DCWOversize for the recessing tool width
TYPETool type: ROUGH, FINISH, THREAD, RECESS, BUTTON, RECTURN (groove turning)

Roughing and finishing tools require ZL, XL, RS, TO, ORI, T-ANGLE, P-ANGLE and TYPE. Recessing tools require CUTWIDTH instead of T-ANGLE and P-ANGLE. The tool must be clamped and measured in the correct position; check the tool orientation before machining.

How do you enter a size correction (wear) for a turning tool?

When you enter the deviation measured on the workpiece, the control calculates DXL and DZL itself (tool management, option 93; the range of functions is defined by the machine tool builder).

StepWhat to doWhat you see
1Select a machine operating mode, e.g. Manual Operation–
2Press the TOOL TABLE soft key–
3Press the TOOL MANAGEMENT soft keyTool management opens
4Press the FORM FOR TOOL soft keyThe form view of the tool opens
5Set the EDIT soft key to ON–
6Select the DXL or DZL field with the arrow keys–
7Press the CALCULATE TOOL COMPENSTN. soft keyA pop-up window opens
8Enter the measured error in Z and in X (as a diameter); press APPLY if requiredThe control calculates the new DZL and DXL values
9Press the OK soft keyThe window closes and the new compensation values are saved in the tool table

Example from the manual: with compensation value Z = 1, compensation X (diameter) = 1, inclination angle 90 and reverse the tool = Yes, the result is DZL +0.5 and DXL +1.

A correction can also be given in the program: FUNCTION TURNDATA CORR-TCS:Z/X DZL:0.1 DXL:0.05 applies additional compensation to the active tool; the values are added to those in the table. A new TOOL CALL deactivates this compensation.

How do you measure unbalance after clamping a workpiece?

If the mass of the rotating workpiece is not evenly distributed, centrifugal forces cause vibration; this harms the machining, shortens tool life and high forces can damage the machine. The manual asks you to check the unbalance after clamping a new workpiece and also between machining steps. These functions are adapted by the machine tool builder and are not available on every machine.

Heidenhain TNC 640 measure unbalance window with balancing weight mass and radial position
Measure unbalance: the control calculates the mass and radial position of the balancing weight.
StepWhat to doWhat you see
1Activate turning mode first (FUNCTION MODE TURN)The cycle runs only in turning mode
2In Manual Operation, shift the soft-key row and press MANUAL CYCLES–
3Press the TURNING soft key–
4Press the MEASURE UNBALANCE soft keyThe control asks for the speed
5Enter the speed for unbalance detection–
6Press NC StartThe table starts at low speed and increases step by step to the entered speed; then a window shows the calculated mass and radial position of the balancing weight
7Clamp the balancing weight and repeat the measurementThe remaining unbalance is shown

If you want to use a different mass or radial position, overwrite one of the two values in the window and have the other recalculated. The unbalance monitor is activated automatically when you switch to turning mode; if the limit set by the builder is exceeded, the control outputs an error message and goes to emergency stop.

How do you select a turning cycle?

StepWhat to doWhat you see
1In the Programming mode press the CYCL DEF keyThe groups of cycles appear
2Press the turning soft keyThe groups of turning cycles appear
3Select the cycle group, e.g. longitudinal stock removalThe cycles of that group appear
4Select the cycle, e.g. 811The dialog opens; type each value and confirm with ENT (part 8 of this series)
Cycle groupCyclesWhat they are for
Special cycles800, 801, 880, 892Adapting and resetting the coordinate system for turning, gear hobbing, unbalance check
Longitudinal stock removal811, 812, 813, 814, 810, 815Longitudinal turning (shoulder, plunge, contour)
Transverse stock removal821, 822, 823, 824, 820Face turning
Recess turning841, 842, 840, 851, 852, 850Radial and axial turning with a recessing tool
Recessing861, 862, 860, 871, 872, 870Radial and axial recessing
Thread cutting831, 832, 830Thread turning

Turning cycles can be used only while FUNCTION MODE TURN is active and are called with CYCL CALL or M99.

What does the turning section of a CAM program look like? (line by line)

The turning part of the example program in the manual shows, in order, everything that must be in the program before the cycle call:

Program lineWhat it does
3 TOOL CALL 12Calls the turning tool
4 M140 MB MAXRetracts the tool
5 FUNCTION MODE TURNActivates turning mode
6 FUNCTION TURNDATA SPIN VCONST:ON VC:150Constant cutting speed 150
7 CYCL DEF 800 ADJUST XZ SYSTEMAdapts the coordinate system for turning and aligns the tool
8 M136Feed rate in mm per revolution
9 L X+165 Y+0 R0 FMAXMoves to the starting point in the plane (Y = center of the lathe spindle)
10 L Z+2 R0 FMAX M304Moves to the set-up clearance and switches on the lathe spindle
11 CYCL DEF 812 SHOULDER, LONG. EXT.Longitudinal shoulder turning cycle with its values
12 CYCL CALL M8Runs the cycle and switches on the coolant
13 M305Stops the lathe spindle

Note: The M codes that start and stop the lathe spindle (M303, M304, M305 in the example) depend on the machine tool builder; check the machine manual for the codes on your machine.

What do Cycles 800 and 801 do?

For turning, the tool must be brought to a suitable angle relative to the lathe spindle. Cycle 800 ADJUST XZ SYSTEM aligns the workpiece coordinate system for turning and orients the tool. It stays in effect until it is reset by Cycle 801 or redefined. The function is machine-dependent and must be adapted by the machine tool builder.

ParameterName in the programMeaning
Q497PRECESSION ANGLEWhen milling spindle and lathe spindle axes are parallel: rotation of the coordinate system around the spindle axis, e.g. to bring the tool into a certain position when space is tight
Q498REVERSE TOOLMirrors the tool by positioning the milling spindle rotated by 180 degrees, so one tool can be used for inside and outside machining. Reset by a new TOOL CALL
Q530INCLINED MACHININGHow the swivel axis is positioned for inclined turning: 0 = the coordinate system is aligned to an already positioned swivel axis. 1 = the swivel axis is positioned with a compensating movement. 2 = positioned without compensating movement. 3 = the angle is calculated but no positioning is done
Q531ANGLE OF INCIDENCEAngle between tool and lathe spindle for inclined turning; the swivel axis angle is calculated from it
Q535ECCENTRIC TURNINGEccentric turning for workpieces that cannot be clamped with the turning center aligned to the lathe spindle axis. Reset at the end of the program or by a program abort

Cycle 801 has no parameters; it resets the settings Q497 and Q498 and the speed limit set by Cycle 800. It does not move the tool to a starting position; the tool stays where it is.

Danger of collision: During eccentric turning the control performs compensating movements when coupling and decoupling, and DCM collision monitoring is not active. Coupling and decoupling must be done while the lathe spindle is stationary.

What do the values of Cycle 811 for longitudinal shoulder turning do?

Heidenhain Cycle 811 longitudinal shoulder turning parameters Q460 Q463 Q493 Q494
Cycle 811: Q493 diameter at contour end, Q494 contour end in Z, Q463 cutting depth, Q460 set-up clearance.

Cycle 811 (SHOULDER, LONGITDNL.) turns a right-angled shoulder longitudinally. The machined area runs from the tool position at the cycle call to the end point defined in the cycle. If the tool is outside the contour at the call, outside machining is performed; if it is inside, inside machining.

ParameterMeaning
Q215Machining operation: 0 = roughing and finishing, 1 = only roughing, 2 = only finishing to final dimension, 3 = only finishing to oversize
Q460Set-up clearance for retraction and pre-positioning
Q493X coordinate of the contour end point (diameter)
Q494Z coordinate of the contour end point
Q463Maximum infeed in radial direction (radius value). The control distributes the cuts evenly
Q478Roughing feed rate. In mm/rev if M136 is programmed, otherwise mm/min
Q483Oversize on the diameter
Q484Oversize in Z
Q505Finishing feed rate. In mm/rev if M136 is programmed, otherwise mm/min
Q506Contour smoothing: 0 = after each cut along the contour, 1 = after the last cut (entire contour), 2 = no smoothing

Caution: The tool position at the cycle call defines the size of the area to be machined. If you change the positioning block before the call (e.g. L X+75 Y+0 Z+2 FMAX M303), the amount of material removed changes too. During finishing the cycle moves the tool to the starting point itself; position the tool so that this approach cannot damage the contour.

Frequently asked questions

Can every TNC 640 do turning?

No. The turning functions require software option 50 and a machine prepared for turning by the machine tool builder. The TNC 640 is a milling control; turning is done on mill-turn machines with a rotary table.

How do you switch to turning mode on a Heidenhain?

With the line FUNCTION MODE TURN in the program. To write it, press SPEC FCT, then the soft keys TURNING PROGRAM FUNCTIONS, BASIC FUNCTIONS, FUNCTION MODE and TURN. Use FUNCTION MODE MILL to return to milling.

Is X a diameter or a radius in turning mode?

A diameter. In turning mode the position display of the X axis shows diameter values with an additional diameter symbol.

In which table is the length of a turning tool entered?

In the turning tool table TOOLTURN.TRN: ZL (Z direction) and XL (X direction). The L and R values in TOOL.T are not effective for turning tools; in TOOL.T only the type TURN is selected in the TYP column.

Is the turning feed rate in mm/rev or mm/min?

In mm per revolution if M136 is programmed, otherwise in mm/min. M137 cancels M136. Feed rates inside turning cycles follow the same rule.

Heidenhain TNC 640 training series

Safety warning and disclaimer

In turning the workpiece rotates: check the clamping, the unbalance and the speed limit (S MAX) for every workpiece, and do not use high speeds with heavy or unbalanced workpieces. Check the program first with Test Run and then on the machine in single block with a low feed override. Turning mode, Cycle 800, the unbalance functions and the lathe spindle M codes depend on the machine tool builder; the machine manual always takes priority.

Mentor CNC cannot be held responsible for tool breakage, scrap parts, machine damage or accidents resulting from the use of the information on this page. Responsibility lies with the person and the company applying it.

Mentor CNC logo

MENTOR CNC
CNC knowledge from the shop floor

Mentor CNC turns hands-on shop-floor experience in CNC turning, CNC milling, CNC controls, cutting tools and engineering calculations into clear, practical technical content.

Our goal is to help operators, students, engineers and shop owners reach accurate information faster and make safer, more efficient decisions in production.