Contents
- Index
- Previous
- Next
An Example of Manually Created NC Code

This example uses all four of the canned cycles to create the part shown in Fig 1. It has an M10 coarse thread. The thread is to be cut by a multi-pitch tool tip. Therefore the root diameter must be 7.8mm and not the ISO diameter of 8.1596mm (see Screw Cutting).
To use the code to make the part, copy everything between the % symbols, including the % symbols, into UNCONVERTED WINHELP MACRO:!EP(`C:\\windows\\notepad.exe',0)Notepad. Give the file a name and save it to this folder C:\WELturn\Turndata with the extension .cnc
Go into WELturn, select the file and continue.
%
* % is the start and end of code marker. Put nothing other than the % sign on those lines. This code is in metric units.
*Name of Part - M10 thread: manually coded example
*Material - Brass
*Length of BILLET - 41
*BILLET Diameter - 15.8
*Length of PART - 26
N10 T1 'select RH tool
N20 S2400 'set spindle speed
N30 G0 X30 Z60 'go to tool change position
'Facing cycle
N40 G0 X15.84 Z1 'Lines MUST begin with N
N50 G88 X-0.4 Z-0.9 F100 H0.5 'Line numbers are optional - but helpful to humans!
N60 G0 X-0.4 Z-0.8
' Longitudinal turning cycle part 1
N70 G0 X16 Z-0.8
N80 G84 X15.2 Z-26 F100 H0.5
N90 G0 X16 Z-26
' Longitudinal turning cycle part 2
N100 G0 X16 Z-0.8
N110 G84 X10.2 Z-18.9 F100 H0.5
N120 G1 X16 Z-18.9 F100
N130 G0 X16 Z-1
'Finishing cut
N140 G1 X-0.4 Z-1 F32
N150 G0 X-0.4 Z1
N160 G0 X10 Z1
N170 G1 X10 Z-19 F32
N180 G1 X15 Z-19 F32
N190 G1 X15 Z-26 F32
N200 G0 X16 Z-26
N210 G0 X30 Z60 'go to tool change position
'Grooving cycle
N220 T6 'select parting tool
N230 G0 X11 Z-14
N240 G86 X7.5 Z-18 F80
N250 G0 X16 Z-14
N260 G0 X30 Z60
'Threading cycle
N270 T4 'select threading tool
N280 S200 'spindle speed for threading
N290 G0 X10.5 Z 0
N300 G78 X7.8 Z-16 F1.5 H0.06
N310 G0 X7.8 Z0
'Four spring cuts using G33
N320 G33 X7.8 Z-16 F1.5
N330 G0 X10.5 Z-16
N340 G0 X10.5 Z0
N350 G0 X7.8 Z0
N360 G33 X7.8 Z-16 F1.5
N370 G0 X10.5 Z-16
N380 G0 X10.5 Z0
N390 G0 X7.8 Z0
N400 G33 X7.8 Z-16 F1.5
N410 G0 X10.5 Z-16
N420 G0 X10.5 Z0
N430 G0 X7.8 Z0
N440 G33 X7.8 Z-16 F1.5
N450 G0 X10.5 Z-16
N460 G0 X30 Z60 'go to tool change position
'Parting off
N470 T6 'select parting tool
N480 S2400 'spindle speed for parting off
N490 G0 X17 Z-23
N500 G1 X0 Z-23 F32
N510 G0 X17 Z-23
N520 G0 X30 Z60 'go to tool change position
'ready to repeat part if required
N530 T1 'Select tool 1 (right hand)
%
Arcs: The Rules for Coding Them
CAD Software as an Aid to NC Code Preparation
Canned Cycles
CNC File Specification
Manually Prepared Code
Screw Cutting
Tool Tip Radius Compensation