Program examples

Program examples

For clarifying the subject introduced till now, a programming example is presented in the following paragraph.

Following address characters are used:

Preparatory functions:

G00 "Rapid traverse"

G01 "Linear interpolation"

Spindle:

S1000 "Spindle speed 1000 rpm."

Feedrate:

F5 "Feedrate 5 mm/min"

Numerical axes:

X, Y, Z "Three Cartesian axes"

Machine functions:

M03 "Spindle right hand rotation at programmed speed"

M05 "Spindle stop"

M30 "Program end"

Programming example

% 100 (program example)
N10 G00 X100 Y100 (Rapid traverse mode of the X- and Y-axes)
(to position 100)
N20 Z100 (Rapid traverse mode of the Z-axis to 100.)
(G00 remains active till deselection by)
(another G-function.)
N30 G1 Z50 F5 S1000 M3 (Spindle right-hand side rotation (1000 rpm)
(and linear interpolation with feedrate)
((5 m/min) to position Z=50)
N40 Z100 (Linear interpolation to Z=100)
N50 G0 X200 Y200 Z200 (Rapid traverse to position X=Y=Z=200)
N50 M5 (Spindle stop)
N60 M30 (Program end)