Home › G-codes › Siemens 808D › G331
G331 Rigid tapping in
Siemens 808D G-code · Mill and lathe
Taps with the spindle in position control, locked to the axis, so no compensating chuck is needed. The sign of the lead sets right or left hand. G332 pulls the tap out with the same lead.
Format
G331 Z K S
Addresses
| Address | What it does |
|---|---|
Z | Tapping depth |
K | Thread lead. Positive for right hand as with M3, negative for left hand as with M4. |
S | Spindle speed, written without M3 or M4 |
How it works
Modal, G group 1 (motion).
Example program
T5 D1 ; TAP, 0.8 MM PITCH
M6 ; TOOL CHANGE
G54 G0 G90 X10 Y10 Z5 ; ABOVE HOLE
SPOS=0 ; SPINDLE TO POSITION CONTROL
…
M6 ; TOOL CHANGE
G54 G0 G90 X10 Y10 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
- Switch the spindle to position control with SPOS= before G331.
- Write S without M3 or M4. The sign of the lead sets the direction.
- The axis speed from rpm times lead must stay under rapid traverse, or the control alarms. Lower S for coarse leads.
Related codes
G331 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Siemens 840D 828D | Rigid tapping in |
Every G-code for Siemens 808D 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 808D G-codes