Example program · Mill

Machining Multiple Parts with G54–G57 — G-Code Example

Runs the same operation on four vises by switching work offsets and calling one subprogram.

By cnccode · Updated

Runs the same operation on four vises by switching work offsets and calling one subprogram.

ItemValue
MachineCNC mill / machining centre (Fanuc-style)
UnitsMetric (G21)
Lines25

Program

G-code
O1009 (4 PARTS G54-G57)
G21 G17 G40 G49 G80 G90
T4 M06 (SPOT DRILL)
S2500 M03
G54 G00 X0 Y0
G43 H04 Z25. M08
M98 P1109
G55 G00 X0 Y0
M98 P1109
G56 G00 X0 Y0
M98 P1109
G57 G00 X0 Y0
M98 P1109
M09
G91 G28 Z0
G90
M30

O1109 (HOLE PATTERN)
G98 G81 X10. Y10. Z-2. R2. F150.
X30.
X30. Y20.
X10.
G80
M99

▶ Simulate in the G-code viewer

How it works

  • Each vise has its own work offset; the subprogram is written once.
  • Probe or indicate every offset before the first run.

Codes used in this program

Always check feeds, speeds, offsets and clearances for your own machine and tooling, and prove new programs with single block and reduced rapid.

More milling programs