K1: Mode group, channel, program operation, reset response
9.7 Block search
Basic Functions
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
517
N310 Z100 D0
; Deselect length correction
End of contour section 2
...
M30
PROC WZW
Tool change routine
N500 DEF INT TNR_AKTIV
; Variable for active T number
N510 DEF INT TNR_VORWAHL
; Variable for preselected T number
N520 TNR_AKTIV = $TC_MPP6[9998,1]
; Read T number of active tool
N530 GETSELT(TNR_VORWAHL)
; Read T number of preselected tool
;
;Execute tool change only if tool is not yet active
N540 IF TNR_AKTIV == TNR_VORWAHL GOTOF ENDE
N550 G0 G40 G60 G90 SUPA X450 Y300 Z300 D0
; Approach tool change position
N560 M6
; Execute tool change
;
END: M17
PROC SUCHLAUF_ENDE SAVE
ASUB
for calling the tool change routine after block search
N1000 DEF INT TNR_AKTIV
; Variable for active T number
N1010 DEF INT TNR_VORWAHL
; Variable for preselected T number
N1020 DEF INT TNR_SUCHLAUF
; Variable for T number determined in
search
N1030 TNR_AKTIV = $TC_MPP6[9998,1]
; Read T number of active tool
N1040 TNR_SUCHLAUF = $P_TOOLNO
; Read T number determined by search
N1050 GETSELT(TNR_VORWAHL)
; Read T number of preselected tool
N1060 IF TNR_AKTIV ==TNR_SUCHLAUF GOTOF ASUP_ENDE
N1070 T = $TC_TP2[TNR_SUCHLAUF]
; T selection by tool name
N1080 WZW
; Call tool change routine
N1090 IF TNR_VORWAHL == TNR_SUCHLAUF GOTOF ASUP_ENDE
N1100 T = $TC_TP2[TNR_VORWAHL]
; Restore T preselection by tool name
ASUP_ENDE:
N1110 M90
; Check-back signal to PLC
N1120 REPOSA
; ASUB end