2 Operation
2 - 33
2.2.1.3. Program Composition
A complete program contains a group of blocks. A block has a serial number and several
commands. Each command is composed of a command code (letters A~Z) and numeric
values ( , ,0~9). An example of a complete part program containing 10 blocks is
shown in the table below. A complete program is assigned with a program number, such
as O001, for identification.
A complete program:
N10 G0 X40.000 Z10.000
N20 G00 X30.000 Z5.000
N30 M3 S3000
N40 G1 X10.000 F200
N50 W-5.000
N60 X15.000 Z-10.000
N70 X30.000 W-10.000
N80 G0 X40.000 Z10.000
N90 M5
N100 M2
Block is the basic unit of a program. A block contains one or more commands. No blank
should be inserted between commands when transmitting a program. A block has the
following basic format:
N-____G____X(U)____Z(W)____F____S____T____M____
N : Block Sequence Number
G : Function Command
X, Z : Coordinate positioning command (absolute movement command).
U, W : Coordinate positioning command (incremental movement command).
F : Feed rate.
S : Spindle speed.
T : Tool command.
M : Auxiliary functions (machine control code).
Except for the block serial number (N), the command group of a block can be classified
into four parts: