Examples
● Example: Tapping with G331 / G332 (Page 241)
● Example: Output the programmed drilling speed in the current gear stage (Page 241)
● Example: Application of the second gear-stage data block (Page 242)
● Example: Speed is not programmed, the gearbox stage is monitored (Page 242)
● Example: Gearbox stage cannot be changed, gearbox stage monitoring (Page 243)
● Example: Programming without SPOS (Page 243)
2.9.11.2 Example: Tapping with G331 / G332
Program code Comment
N10 SPOS[n]=0 ; Spindle: Position control mode
; Start position 0 degrees
N20 G0 X0 Y0 Z2 ; Axes: Approach starting position
N30 G331 Z-50 K-4 S200 ; Tapping in Z,
; Pitch K-4 negative =>
; Direction of spindle rotation: CCW
rotation,
; Spindle speed 200 rpm
N40 G332 Z3 K-4 ; Retraction motion in Z,
; Pitch K-4 negative (counterclock-
wise),
; autom. direction of rotation reversal
=>
; Clockwise spindle direction of rota-
tion
N50 G1 F1000 X100 Y100 Z100 S300 M3 ; Spindle in spindle operation
2.9.11.3 Example: Output the programmed drilling speed in the current gear stage
Program code Comment
N05 M40 S500 ; Programmed spindle speed: 500 rpm =>
; Gearbox stage 1 (20 to 1028 rpm)
...
N55 SPOS=0 ; Position the spindle
N60 G331 Z-10 K5 S800 ; Tapping
; Spindle speed 800 rpm => gearbox stage 1
The appropriate gear stage for the programmed spindle speed S500 with M40 is determined on
the basis of the first gear-stage data block. The programmed drilling speed S800 is output in the
current gear stage and, if necessary, is limited to the maximum speed of the gear stage. No
Fundamentals
2.9 Motion commands
NC programming
Programming Manual, 12/2019, 6FC5398-2EP40-0BA0 241