Heidenhain TNC 640 Training 8: Cycles (CYCL DEF) – Drilling, Tapping and Pockets

12 November 2026

Mentor CNC Editorial Team

Part 8 of the Heidenhain TNC 640 training series explains cycles (CYCL DEF) from the operator’s side: what a cycle looks like in a CAM program, which key brings up which screen, how to change a depth or feed rate at the machine and how a cycle is called. It then goes through the values of the drilling (200), rigid tapping (207) and rectangular pocket (251) cycles one by one. The information is taken from the Heidenhain cycle programming and conversational programming user’s manuals.

What is a cycle on a Heidenhain control and how does it look in the program?

Frequently recurring operations that consist of several working steps (drilling, tapping, pocket milling) are stored in the control as ready-made cycles. The values of a cycle are entered as Q parameters. In the program a cycle looks like this:

Program lineWhat it means
11 CYCL DEF 200 DRILLINGCycle definition: drilling cycle number 200. The tool does not move in this line
Q201=-15 ;DEPTHOne value of the cycle. The text after the semicolon is a comment added by the control
12 L X+30 Y+20 FMAX M3Move to the hole center and switch on the spindle
13 CYCL CALLRun the cycle once at this position
14 L X+80 Y+50 FMAX M99Move to the new position and run the cycle there too

Rule to remember: For machining cycles, CYCL DEF only defines; the tool starts cutting in the CYCL CALL or M99 line.

How do you add a new cycle to a program? (key by key)

Heidenhain TNC 640 cycle definition screen with CYCL DEF 200 and help graphic
Cycle definition: program and dialog prompt on the left, help graphic for the requested value on the right.
StepWhat to doWhat you see
1Press the Programming operating mode keyThe program is on the screen
2Use the up / down arrow keys to select the block after which the cycle should be insertedThe block is highlighted
3Press the CYCL DEF keyThe soft-key row shows the groups of cycles
4Select the group, for example the DRILLING/ THREAD soft keyThe cycles of that group appear as soft keys with number and small picture (200, 203, 207 …)
5Select the cycle, for example the 200 soft keyThe dialog opens: the first prompt appears (e.g. Set-up clearance?), a help graphic is shown in the right half of the screen and the requested parameter is highlighted in it
6Type the value and press ENTThe next prompt appears
7Repeat for all prompts: type the value, ENTAfter the last value the control ends the dialog; the cycle is in the program

How do you pick a cycle from the list with GOTO?

StepWhat to doWhat you see
1Press the CYCL DEF keyThe groups of cycles appear
2Press the GOTO keyThe smartSelect window with an overview of the cycles opens
3Select the cycle with the arrow keys or the mouseThe cycle dialog opens as described above

Which cycle groups appear on the CYCL DEF key?

Soft keyCycles in the group
DRILLING/ THREADDrilling, pecking, reaming, boring, counterboring; tapping, thread cutting and thread milling
POCKETS/ STUDS/ SLOTSPocket, stud, slot and face milling
COORD. TRANSF.Coordinate transformation: shifting, rotating, mirroring, enlarging and reducing
SL cyclesContours made up of several overlapping subcontours, cylinder surface machining
PATTERNPoint patterns: holes on a circle and on lines
TurningTurning (mill-turn) and gear hobbing cycles
SPECIAL CYCLESDwell time, program call, oriented spindle stop, engraving, tolerance

The machine tool builder can add own cycles: numbers 300 to 399 on the CYCL DEF key and touch probe cycles 500 to 599 on the TOUCH PROBE key. They are described in the machine manual.

How do you change a depth or feed rate in a cycle of a CAM program?

StepWhat to doWhat you see
1Open the program in the Programming modeThe program is on the screen
2Use the up / down arrow keys to go to the Q line you want to change, e.g. Q201=-15 ;DEPTHThe line is highlighted
3Press the right arrow key to move onto the valueThe value is highlighted and its dialog prompt appears
4Type the new valueIt overwrites the old value
5Press the END keyThe change is concluded

The control usually saves changes automatically when you switch the operating mode or open the file manager; to save at once use the STORE soft key. If you want to delete a cycle that consists of several lines, the control asks whether the whole cycle should be deleted.

Caution: Cycles execute extensive operations. After changing a value, run a Test Run before machining (part 6 of this series).

How is a cycle called? CYCL CALL, M99 and M89

CallWhat it does
CYCL CALLCalls the most recently defined cycle once. The starting point is the position programmed last before the CYCL CALL block
M99 (at the end of a positioning block)The control moves to that position and calls the last defined cycle once
M89The cycle runs automatically after every positioning block. Cancel with M99 in the block moving to the last position, or by defining a new cycle with CYCL DEF
CYCL CALL PATCalls the cycle at all positions defined in a PATTERN DEF pattern or a point table
CYCL CALL POSCalls the cycle once at the position written in the block; three axes must always be programmed in it
StepWhat to doWhat you see
1Press the CYCL CALL keyThe cycle call soft keys appear
2Press the CYCL CALL M soft keyThe control asks for a miscellaneous function
3Enter an M function if needed (e.g. M3 to switch on the spindle) or end with the END keyThe call block is written into the program

Before a cycle call the program must contain: a tool call (TOOL CALL), the direction of spindle rotation (M3/M4) and the cycle definition (CYCL DEF). BLK FORM is needed only for the test graphics.

Cycles that are not called: These cycles take effect from the line in which they are defined: coordinate transformation cycles (7, 247, 8, 10, 11, 26, 19), 32 TOLERANCE, 9 DWELL TIME, point patterns 220 and 221, SL cycles 14 CONTOUR and 20 CONTOUR DATA, and all touch probe cycles.

How does Cycle 200 DRILLING work and what do its values mean?

Heidenhain Cycle 200 drilling parameters Q200 Q201 Q202 Q203 Q204 Q206 Q210
Cycle 200: Q203 workpiece surface, Q200 set-up clearance, Q201 depth, Q202 plunging depth, Q204 2nd set-up clearance.
StepWhat the tool does
1Moves at rapid traverse (FMAX) to the set-up clearance above the workpiece surface
2Drills to the first plunging depth at the programmed feed rate F
3Retracts at FMAX to the set-up clearance, dwells there if a dwell is entered, then moves at FMAX to the set-up clearance above the first plunging depth
4Drills one more plunging depth at feed rate F; steps 2 to 4 repeat until the total depth is reached
5Retracts from the hole bottom at FMAX to the set-up clearance or, if entered, to the 2nd set-up clearance
ParameterName in the programMeaning
Q200SET-UP CLEARANCEDistance between tool tip and workpiece surface (incremental). Enter a positive value
Q201DEPTHDistance from workpiece surface to hole bottom (incremental). Enter a negative value
Q206FEED RATE FOR PLNGNGDrilling feed rate in mm/min. Alternatives: FAUTO, FU
Q202PLUNGING DEPTHInfeed per cut (incremental). If it is equal to or greater than the depth, the control drills in one step
Q210DWELL TIME AT TOPDwell at set-up clearance after retracting from the hole for chip removal, in seconds
Q203SURFACE COORDINATECoordinate of the workpiece surface (absolute)
Q2042ND SET-UP CLEARANCEHeight at which no collision between tool and workpiece or fixtures can occur (incremental)
Q211DWELL TIME AT DEPTHDwell at the hole bottom, in seconds
Q395Depth reference0 = depth refers to the tool tip; 1 = depth refers to the cylindrical part of the tool (point angle T-ANGLE must be defined in the tool table)

Danger of collision: If a positive depth is entered, the control reverses the pre-positioning and the tool moves at rapid traverse to the set-up clearance below the workpiece surface. Enter the depth as a negative value. The machine parameter displayDepthErr (no. 201003) defines whether the control outputs an error message for a positive depth. With depth = 0 the cycle is not executed.

What other drilling cycles are there?

CycleNameWhat it does
240CENTERINGCentering; centering diameter or depth can be entered
200DRILLINGDrilling in several infeeds
201REAMINGReaming
202BORINGBoring
203UNIVERSAL DRILLINGDrilling with chip breaking and decrement
204BACK BORINGBack boring
205UNIVERSAL PECKINGDeep-hole pecking with chip breaking
208BORE MILLINGMilling a hole with an end mill
241SINGLE-LIP DEEP-HOLE DRILLINGDeep-hole drilling with a single-lip drill

How do you use tapping Cycle 207?

Heidenhain Cycle 207 rigid tapping parameters Q200 Q201 Q203 Q204 Q239
Cycle 207: Q239 pitch, Q201 thread depth, Q200 set-up clearance.

Cycle 207 (RIGID TAPPING NEW) cuts the thread without a floating tap holder. It can be used only on machines with a controlled spindle; machine and control must be prepared by the machine tool builder. The tool moves at FMAX to the set-up clearance, goes to the thread depth in one movement, the spindle reverses, the tool retracts to the set-up clearance and the spindle stops.

ParameterName in the programMeaning
Q200SET-UP CLEARANCEDistance between tool tip and workpiece surface (incremental)
Q201DEPTHDistance from workpiece surface to the bottom of the thread (incremental). Enter a negative value
Q239PITCHThread pitch. The sign defines the direction: + right-hand thread, – left-hand thread
Q203SURFACE COORDINATECoordinate of the workpiece surface (absolute)
Q2042ND SET-UP CLEARANCEHeight at which no collision can occur (incremental)
TopicWhat the manual says
PotentiometersThe spindle speed potentiometer is inactive. Whether the feed rate potentiometer can be used during tapping is configured by the machine tool builder
SpindleIf M3 or M4 is programmed before the cycle, the spindle keeps turning after the cycle. If not, it stops and must be switched on again with M3 or M4 before the next operation
Pitch checkIf a pitch is entered in the Pitch column of the tool table, the control compares it with the pitch in the cycle and outputs an error message if they differ
Other tapping cycles206 TAPPING NEW: tapping with a floating tap holder. 209 TAPPING W/ CHIP BREAKING. 262 THREAD MILLING: milling a thread into a pre-drilled hole

How do you retract the tap if the program is stopped during tapping?

StepWhat to doWhat you see
1Press the NC Stop keyThe control shows the MANUAL TRAVERSE soft key
2Press MANUAL TRAVERSEThe tool can be moved in the active spindle axis
3Move the tool in the direction that takes it out of the hole–
4To continue machining, press the RESTORE POSITION soft key and NC StartThe control returns the tool to the position before the NC stop

Danger of collision: During retraction the tool can be moved in both the positive and the negative direction of the tool axis. Be sure which direction leads out of the hole before you move.

What do the values of Cycle 251 RECTANGULAR POCKET do?

Heidenhain Cycle 251 rectangular pocket parameters Q218 Q219 Q220 Q207
Cycle 251: Q218 first side length, Q219 second side length, Q220 corner radius, Q207 feed rate for milling.

Cycle 251 machines a rectangular pocket completely, with roughing and finishing.

ParameterName in the programMeaning
Q215MACHINING OPERATION0 = roughing and finishing, 1 = only roughing, 2 = only finishing
Q218FIRST SIDE LENGTHPocket length parallel to the principal axis
Q2192ND SIDE LENGTHPocket length parallel to the secondary axis
Q220CORNER RADIUSRadius of the pocket corner. With 0 the corner radius equals the tool radius
Q368ALLOWANCE FOR SIDEFinishing allowance on the walls
Q224ANGLE OF ROTATIONAngle by which the whole operation is rotated; the center of rotation is the tool position at the cycle call
Q367POCKET POSITIONPocket position relative to the tool position at the call: 0 = pocket center, 1 = lower left, 2 = lower right, 3 = upper right, 4 = upper left corner
Q207FEED RATE FOR MILLINGMilling feed rate in mm/min
Q351CLIMB OR UP-CUT+1 = climb milling, -1 = up-cut milling (with M3)
Q201DEPTHDistance from workpiece surface to pocket floor. Enter a negative value
Q202PLUNGING DEPTHInfeed per cut; enter a value greater than 0
Q369ALLOWANCE FOR FLOORFinishing allowance on the floor
Q206FEED RATE FOR PLNGNGFeed rate when moving to depth, mm/min
Q338INFEED FOR FINISHINGInfeed in the spindle axis per finishing cut. 0 = finishing in one infeed
Q200 / Q203 / Q204SET-UP CLEARANCE / SURFACE COORDINATE / 2ND SET-UP CLEARANCESame meaning as in Cycle 200
Q370TOOL PATH OVERLAPQ370 x tool radius = stepover
Q366PLUNGEPlunging strategy: 0 = vertical, 1 = helical, 2 = reciprocating. For 1 and 2 the plunging angle ANGLE in the tool table must not be 0, otherwise the control outputs an error message
Q385FEED RATE FOR FINISHINGFeed rate for side and floor finishing, mm/min
Q439Feed rate referenceWhether the programmed feed rate refers to the tool center path or to the cutting edge (0 to 3)

Danger of collision: If the cycle is called with Q215=2 (only finishing), the tool is pre-positioned at rapid traverse to the first plunging depth plus set-up clearance. Roughing must have been done before. The depth is entered as a negative value here too.

The same group contains 252 CIRCULAR POCKET, 253 SLOT MILLING, 254 CIRCULAR SLOT, 256 RECTANGULAR STUD, 257 CIRCULAR STUD and Cycle 233 for face milling. Cycles with numbers above 200 always use the same parameter number for the same purpose; the set-up clearance, for example, is Q200 in every cycle.

What do Cycles 247, 7 and 32 at the start of a CAM program do?

CycleLine in the programWhat it does
247 DATUM SETTINGCYCL DEF 247 DATUM SETTING with Q339=4 ;DATUM NUMBERActivates line 4 of the preset table as the new preset. When it is activated, the control resets datum shift, mirroring, rotation and scaling factor
7 DATUM SHIFTCYCL DEF 7.0 DATUM SHIFT, 7.1 X+60, 7.2 Y+40, 7.3 Z-5All following coordinates refer to the shifted datum. Reset by defining it again with X0, Y0, Z0
32 TOLERANCECYCL DEF 32.0 TOLERANCE, 32.1 T0.05Permissible contour deviation for high-speed machining. The larger the value, the faster the machine moves. The manual recommends 1.1 to 2 times the CAM chord error
19 WORKING PLANECYCL DEF 19.0 WORKING PLANE, 19.1 A+0 B+45 C+0Tilts the working plane on machines with swivel heads or tilting tables (software option)

These cycles are not called; they take effect from the line in which they are written and stay active until they are reset, redefined or a new program is selected. Operator check: Make sure the Q339 number in the program is the preset table line in which you set the workpiece zero (part 5 of this series). The number of the active preset is shown in the status display next to the preset symbol.

What does PREDEF in a cycle mean? (GLOBAL DEF)

With GLOBAL DEF, common values such as set-up clearance, 2nd set-up clearance or retraction feed rate are defined once at the start of the program. If a cycle shows PREDEF instead of a value, that value is taken from the GLOBAL DEF block at the program start. When defining a cycle, this link is made with the SET STANDARD VALUES soft key.

Danger of collision: If a GLOBAL DEF value is changed later, the change affects the cycles in the entire program. Run a Test Run after such a change.

Frequently asked questions

How do you define a cycle on a Heidenhain control?

In the Programming mode press the CYCL DEF key, then select the cycle group (e.g. DRILLING/ THREAD) and the cycle (e.g. 200) by soft key. The control asks for the values one after the other; type each value and press ENT.

What is the difference between CYCL DEF and CYCL CALL?

CYCL DEF defines the cycle and its values. CYCL CALL runs the most recently defined machining cycle once at the position reached in the previous block. M99 at the end of a positioning block does the same.

Why is the depth negative in a Heidenhain cycle?

The algebraic sign of the depth parameter determines the working direction. With a positive depth the control reverses the pre-positioning and the tool moves at rapid traverse below the workpiece surface, which is a collision risk.

How do you program a left-hand thread in Cycle 207?

Enter the pitch Q239 with a negative sign. A positive sign means a right-hand thread, a negative sign a left-hand thread.

What is the difference between M99 and M89?

M99 is active only in the block in which it is programmed and calls the cycle once. After M89 the cycle runs automatically after every positioning block; it is cancelled by M99 in the last positioning block or by a new CYCL DEF.

Heidenhain TNC 640 training series

Safety warning and disclaimer

After changing a value in a cycle, check the program first with Test Run and then on the machine in single block with a low feed override. Check the sign of the depth, the clearances and the surface coordinate every time. The scope and some behavior of the cycles depend on the machine tool builder and the software version; 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.