CNC Programing Concept
CNC Programing Concept
CNC Program
A Sequence of Instructions
Start-up Instructions
Program Start
Program Number
Sequence of Machine Instructions for a Controller
Each instruction is comprised of CNC “machine
machine specific codes”
codes
(commands)
The Controller uses individual Codes to move, position the spindle
and machine a part
Instructions are listed sequentially in numbered blocks
Controller executes instructions sequentially
G-codes are preparatory functions involve actual tool moves: Refer page 74
Rapid moves, radial feed moves
M-codes are Miscellaneous functions: Refer pages 72 - 73
Spindle on/of tool changes,
changes coolant on/of program stop
%
:1001
N5 G90 G20
N10 M06 T2
N15 M03 S1200
Rapid down to Z
Z.1 1 just above the part N25 Z0.125
Feed down to Z-0.125 inches at 5 ipm N30 G01 Z-0.125 F5.0
Feed diagonally to X2, Y2 N35 G01 X2.0 Y2.0
Rapid
p up p to Z1 ((clear the p
part)) N40 G00 Z1
Z1.0
0
Rapid back home to X0, Y0 N45 X0 Y0
G00 in N20 (G01 in N35) remains active until N50 M05
overridden by G01 in N30 (G00 in N40):
N55 M30
Modal G Codes
%
:1001
N5 G90 G20
N10 M06 T2
N15 M03 S1200
N20 G00 X1.00 Y1.00
N25 Z0.125
N30 G01 Z-0.125 F5.0
N35 G01 X2.0 Y2.0
N40 G00 Z1
Z1.0
0
N45 X0 Y0
Order:
Block number, G-code, Coordinate, Special Function
Components:
C t
N135 - Shows current CNC block number
G01 – Command that instructs the machine to do something (linear feed move –
See page 74)
X1.0 Y1.0 Z0.125 – Specifies
p the endpoint
p to move the spindle
p
F5.0 – Any special function or related parameter is included here (feed rate of 5
inch per minute)