Heidenhain TNC 640 Training 6: Running and Resuming an Interrupted Program

12 November 2026

Mentor CNC Editorial Team

Part 6 of the Heidenhain TNC 640 training series covers running a CAM program on the machine, stopping it and resuming an interrupted program where it left off: Test Run, single block, NC Stop and INTERNAL STOP, mid-program startup with BLOCK SCAN, returning to the contour and retracting the tool after a power failure. The information is taken from the Heidenhain TNC 640 Conversational Programming User’s Manual.

How do you run a program on a Heidenhain control?

PreparationDescription
1. Clamp the workpieceClamp the workpiece on the machine table
2. Set the presetWorkpiece zero (part 5 of this series)
3. Select the tablesSelect the required tables and pallet files (status M)
4. Select the programSelect the machining program with PGM MGT
Operating modeHow it worksWhen to use it
Program Run Single BlockEach NC block is started separately with NC Start. In point pattern cycles the control stops after each pointFirst part from a new program
Program Run Full SequenceThe program runs continuously with NC Start until the end or until an interruptionSeries production

Feed rate and spindle speed can be changed with the override potentiometers. The F MAX soft key limits all rapid and feed movements; this limit stays active after the machine is switched off and on.

How do you check a program with Test Run before running it?

Heidenhain TNC 640 Test Run 3D simulation screen
Test Run: 3D material removal simulation without moving the machine.
StepWhat to doWhat you see
1Press the Test Run operating mode key–
2Select the program to be tested with PGM MGTThe test soft keys appear
3To reset the blank form and tool data and test the entire program, press RESET + STARTThe simulation starts
4To test block by block, press the single block soft keyOne NC block is run per press
5To stop the test, press the STOP soft keyThe simulation stops and can be continued

You can interrupt and continue the test at any time, even within fixed cycles. To continue the test, do not select another block with the arrow keys or GOTO, do not change the program and do not select a new program. For Test Run, a tool table must be selected in file management (status S).

How do you run the Test Run up to a certain block?

Heidenhain TNC 640 Test Run up to block number pop-up window
STOP AT: enter the block number at which the simulation should stop.
StepWhat to doWhat you see
1Press the STOP AT soft keyA pop-up window opens
2Stop at: N = enter the block number at which the simulation should stop–
3Program = check the program name; if the block is in a program called with PGM CALL, enter that name–
4If the block is inside a program section repeat, enter the repeat number in Repetitions =The test runs up to that block

In this stopped state you can switch block skip and optional stop on or off, change the graphics resolution and model, and edit the program. A change before the interruption point restarts the simulation from the beginning; after a change behind the interruption point you can position to it with GOTO.

Note: The graphic simulation cannot show every real machine movement, for example tool change movements that the machine tool builder defines in a tool change macro or via the PLC. Even when the test shows no error, try every new program carefully on the machine.

How do you stop or abort a program?

MethodWhat happens
STOP or M0 in the programThe control interrupts the program in that block
M1 in the programOptional stop; the program stops only if the soft key is ON. With M1 the spindle and coolant are not switched off
Selecting Program Run Single Block while runningThe control stops at the end of the current machining step
NC Stop keyThe control does not exit the current NC block. Changing the operating mode is not possible; resume with NC Start
NC Stop, then the INTERNAL STOP soft keyThe program is aborted; the operating mode can be changed. To re-enter you need the program start or BLOCK SCAN
M2 or M30 in the programThe program is terminated

Danger of collision: Certain manual interactions make the control lose program information (the contextual reference): moving the cursor to another NC block, jumping with GOTO to another NC block, editing an NC block, changing Q parameters with Q INFO, or switching the operating mode. Unexpected movements can follow. Restore the contextual reference by repeating the required NC blocks.

How do you retract the spindle after a tool breakage?

During an interruption you can move the machine axes in the same way as in Manual Operation mode.

StepWhat to doWhat you see
1Interrupt machining (NC Stop)–
2Press the MANUAL TRAVERSE soft keyThe axis direction keys are enabled
3Move the axes with the axis direction keys (retract with Z+ first)–

On some machines you must also press NC Start after the MANUAL TRAVERSE soft key to enable the axis direction keys. If the tilted working plane was active, check the 3D ROT setting; the manual recommends the TOOL AXIS function and a low feed rate. If you change the active preset during an interruption, you can only resume with GOTO or mid-program startup at the interruption point.

How do you resume a stopped program where it left off?

SituationHow to resume
Stopped with NC StopNC Start key
Stopped by STOP, M0 or M1 in the programNC Start key
An erasable error message appearedRemove the cause, clear the message with CE, then restart or resume where it was interrupted
Aborted with INTERNAL STOPFrom the program start or with BLOCK SCAN
Axes were moved manuallyReturn to the contour with RESTORE POSITION (see below)

During an interruption the control saves the last tool called, the active coordinate transformations (datum shift, rotation, mirroring) and the last defined circle center. It uses this data when returning the tool to the contour.

How do you re-enter an interrupted program with BLOCK SCAN?

Danger of collision: When you enter a program with GOTO and a block number, neither the control nor the PLC performs any function that ensures a safe entry. For a safe entry always use BLOCK SCAN. This function must be enabled and configured by the machine tool builder.

BLOCK SCAN starts the NC program at any NC block; machining up to this block is included in the calculation. If the program was stopped with INTERNAL STOP, an emergency stop or a power failure, the control saves the interruption point.

Heidenhain TNC 640 BLOCK SCAN mid-program startup window
BLOCK SCAN: start-up block, program and repetitions.
StepWhat to doWhat you see
1In Program Run, press the BLOCK SCAN soft keyA pop-up window with the active main program opens
2Start-up at: N = enter the NC block number where you want to start–
3Program = check the name and path (or use the SELECT soft key)–
4If the block is inside a program section repeat, enter the repeat number in Repetitions = (1 = first)–
5If required, press ADVANCED and INSERT LAST NC BLOCK to select the last saved interruption–
6NC StartThe control calculates up to the entered block
7If the machine status changed: NC StartThe control restores TOOL CALL and M functions
8If the axis positions changed: NC StartThe control moves the axes to the positions in the displayed sequence
9NC StartThe program continues

Example from the manual: after an internal stop, to start in block 12 in the third machining operation of LBL 1, enter N = 12 and Repetitions = 3.

Point to noteWhat the manual says
Machining cyclesMid-program startup is always executed at the start of the cycle; if the program was interrupted during a cycle, steps already done are repeated
Subprograms and repeatsIf interrupted inside a program section repeat or subprogram, re-enter at the interruption point with BLOCK SCAN
StartThe control resets all data at the start, as when selecting the program. You can switch between Single Block and Full Sequence during the scan
Touch probe cyclesBLOCK SCAN skips probing cycles, so their result parameters may be empty or wrong; use multi-level startup if later machining uses them

How do you start inside a subprogram called from the main program? (multi-level)

StepWhat to doWhat you see
1Press BLOCK SCAN, enter the block of the subprogram call in the main program, press NC StartThe control calculates up to that block
2Press NC Start as needed to restore machine status and position, and to run the blockThe control jumps into the subprogram
3Press CONTINUE BLOCK SCAN and enter the start-up block in the subprogram–
4If required, NC Start for machine status and position–
5NC StartThe control continues the subprogram

How do you return to the contour?

The RESTORE POSITION function moves the tool back to the workpiece contour after the axes were moved during an interruption that was not done with INTERNAL STOP, or after a block scan.

Heidenhain TNC 640 RESTORE POSITION return to the contour
RESTORE POSITION: the axes move back in the control’s or your chosen sequence.
StepWhat to doWhat you see
1Press the RESTORE POSITION soft key–
2Restore the machine status if required–
3To approach in the sequence shown by the control, press NC StartThe axes move in sequence
4To approach in your own sequence: SELECT AXIS, first axis soft key, NC Start; second axis, NC Start; repeat for all axesThe axes move in your sequence

Note: If the tool is below the starting point in the tool axis, the control offers the tool axis as the first traverse direction. When you choose the sequence yourself, consider the current tool position and the workpiece.

How do you free the tool after a power failure? (Retraction)

The Retraction operating mode lets you disengage the tool after a power interruption, a missing relay control voltage or when reference points must be traversed. The machine tool builder must configure and enable it. Traverse modes are Machine axes, Tilted system, Tool axis and Thread.

Heidenhain TNC 640 Power interrupted message
Power interrupted message after switching on.
StepWhat to doWhat you see
1Switch on the power for control and machineThe control starts (may take several minutes) and shows Power interrupted in the header
2Press the RETRACT soft keyThe message Retraction selected appears
3Confirm the power interruption with CEThe control compiles the PLC program
4Switch on the machine control voltageFor non-referenced axes, compare the displayed and actual positions and confirm
5Check the preselected traverse mode and parameters (e.g. THREAD, thread pitch, direction of rotation)–
6Press the RETRACT soft keyRetraction is active
7Retract the tool with the axis direction keys or the handwheel (Z+ out of the workpiece)–
8Press END RETRACTION; if the tool was retracted correctly, press YESRetraction mode ends
9If required, cross the reference points and reset the tilted working planeThe machine is ready

Danger to tool and workpiece: For non-referenced axes the control uses the last saved axis values, which can differ from the real position, and traverse range monitoring is not available. If the tool is still engaged, use a low feed rate.

Heidenhain TNC 640 Retraction operating mode parameters
Retraction: traverse mode and parameters.

How do you skip marked blocks and stop at M1?

FunctionSoft key ONSoft key OFF
Block skip (blocks marked with /)Blocks with / are not run or testedBlocks with / are run
Optional stop (M1)The program stops at blocks with M1No stop at M1

Block skip does not work for TOOL DEF blocks; after a power interruption the last setting is restored. The behavior of M1 depends on the machine.

Frequently asked questions

How do you resume an interrupted program on a Heidenhain?

If the program was stopped with NC Stop, press NC Start. After INTERNAL STOP, an emergency stop or a power failure, use the BLOCK SCAN soft key in Program Run, enter the start-up block and continue with NC Start.

Can I jump to a line with GOTO and start from there?

The manual does not recommend it: with GOTO and a block number neither the control nor the PLC ensures a safe entry. Use BLOCK SCAN for a safe entry.

What is the difference between NC Stop and INTERNAL STOP?

NC Stop halts the program; you continue with NC Start and cannot change the operating mode. INTERNAL STOP aborts the program; the operating mode can be changed, but re-entry needs the program start or BLOCK SCAN.

What happens if I re-enter a program interrupted inside a cycle?

Mid-program startup is always executed at the start of the cycle. If the program was interrupted during a cycle, the machining steps already done are repeated.

The power failed with the tool inside the workpiece. What should I do?

Switch on the machine and select the Retraction mode with the RETRACT soft key. Check the traverse mode and free the tool slowly with the axis keys or handwheel. This function depends on the machine tool builder enabling it.

Heidenhain TNC 640 training series

Safety warning and disclaimer

When entering a program mid-way and returning to the contour, run the machine in single block with a low feed override, watch the remaining path and keep your hand near the NC Stop key. BLOCK SCAN, Retraction and M1 behavior 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.