Flexible NC programming
1.12 Check structures
Example
Tool change subprogram
Program code
PROC L6
N500 DEF INT TNR_AKTUELL
N510 DEF INT TNR_VORWAHL
N520 STOPRE
N530 IF $P_ISTEST
N540 TNR_AKTUELL = $P_TOOLNO
N550 ELSE
N560 TNR_AKTUELL = $TC_MPP6[9998,1]
N570 ENDIF
N580 GETSELT(TNR_VORWAHL)
N590 IF TNR_AKTUELL <> TNR_VORWAHL
N600 G0 G40 G60 G90 SUPA X450 Y300 Z300 D0
N610 M206
N620 ENDIF
N630 M17
110
Comments
; Tool change routine
; Variable for active T number
; Variable for pre-selected T
number
; Determine current tool
; In the program test mode ...
; ... The "current" tool is read
from the program context.
; Otherwise ...
; ... The tool of the spindle is
read-out.
; Read the T number of the pre-
selected tool in the spindle.
; If the pre-selected tool is
still not the current tool,
then ...
; ... Approach tool change
position ...
; ... and execute a tool change.
Programming Manual, 06/2009, 6FC5398-2BP20-0BA0
Job Planning