8 Basic CNC Programming
8.2 General Programming Suggestions
97
N1
This is the block sequence number for the program. Block 1 is the first block in the program.
G90
Indicates absolute coordinates are used to define tool position.
G01
Specifies linear interpolation.
X.5
Specifies the X axis destination position as 0.5".
Y.5
Specifies the Y axis destination position as 0.5".
Z1.5
Specifies the Z axis destination position as 1.5". The cutting tool will move to the absolute
coordinate position (0.5, 0.5,1.5).
F1
Specifies a feed rate of 1 inch per minute, the relative velocity at which the tool is advanced
along the workpiece.
8.2.
GENERAL PROGRAMMING SUGGESTIONS
The following rules should be followed when writing NC part programs.
Info Table: General Programming Suggestions
Topic
Description
Sequence of words in a block
The sequence of words (address characters and parameters) in an NC block
must appear in the following order: %, \, /, N (O), G, X (U),Z (W), l, K, R, Q, L,
F, M, S, T, P, ;
A different order may cause unpredictable results.
Repeating words in multiple
lines
In many cases, a word need not be repeated in the next block (line). The
system assumes no change in codes unless a new code appears.
This does not apply to the following codes: N words, I and K, G04, G05, G25,
G26, G92, F used for dwell, M02, M20, M25, M26, M30, M47, M98 or M99.
Multiple G words in a single
block
You can use more than one G code in a block; however, you can use only one
G code from any one group in a single block.
M codes in a single block
M codes should be placed on separate blocks to avoid confusion over
whether an M code is activated during or after a motion command.
Use of N words
N codes (sequence numbers) are not required in a part program; however,
they can be useful in identifying a block when editing a long NC part
program.
Use of O words
An O code is required to mark the beginning of a subprogram and does not
have to be in sequence with the N codes.
First steps in a part program
The first portion of a part program should turn on the spindle and establish
the feed rate and spindle speed.
Referencing the zero point
Part programs should reference the zero point with X0Y0Z0 at the front left
corner of the work piece. This convention allows for standardization of
programming.
First movement command in
program
The first instruction in a part program should move the tool to the starting
position. This makes restarts much easier.