Home › G-codes › Siemens 840D 828D › G331
G331 Rigid tapping in
Siemens 840D 828D G-code · Mill and lathe
Taps with the spindle in position control, synchronized to the axis. No compensating chuck needed. Program SPOS first, then G331 in, then G332 out.
Format
G331 Z K [S]
Addresses
| Address | What it does |
|---|---|
Z | Tapping depth |
K | Thread lead. Positive for right hand, negative for left hand thread. |
S | Spindle speed for tapping |
How it works
Modal, G group 1 (motion).
Example program
T5 D1 ; M10 X 1.5 TAP
M6
G0 X20 Y20 Z5 ; ABOVE HOLE
SPOS=0 ; SPINDLE TO POSITION CONTROL
…
M6
G0 X20 Y20 Z5 ; ABOVE HOLE
SPOS=0 ; SPINDLE TO POSITION CONTROL
…
The full 7-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Program SPOS first so the spindle is in position control. Without it the control alarms.
- G332 must follow with the same lead to pull the tap out.
- In G17 the lead is K for the Z axis.
Related codes
Every G-code for Siemens 840D 828D in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open G331 in the app All Siemens 840D 828D G-codes