02-01-2023, 04:48 PM
Is there an option to put the reference frame and TCP in every subprogram generated by the post processor?
I want to use a program structure where I have one program per station. This program should consist of all approach and retract subprograms for this station. I want to be able to call this subprograms from other programs which I would code manually.
I did not find a better way to achieve this than to create a program where I call all the subprograms of the station and put an
around the calls so I don't accidentally execute the code:
Each subprogram defines the reference frame and TCP:
But while generating the program with the post processor (a customized KRC4 DAT pp) RoboDK seems to be smart enough to recognize that it does not need to define the reference frame and TCP for each new subprogram when they didn't change between subprogram calls:
Unfortunately this is not the behavior that I need.
I want to use a program structure where I have one program per station. This program should consist of all approach and retract subprograms for this station. I want to be able to call this subprograms from other programs which I would code manually.
I did not find a better way to achieve this than to create a program where I call all the subprograms of the station and put an
Code:
IF FALSE THEN
...
ENDIF
Each subprogram defines the reference frame and TCP:
But while generating the program with the post processor (a customized KRC4 DAT pp) RoboDK seems to be smart enough to recognize that it does not need to define the reference frame and TCP for each new subprogram when they didn't change between subprogram calls:
Code:
DEF sws_magazin()
; Program generated by RoboDK v5.5.3 for KUKA KR10 R1100-2 on 01/02/2023 17:27:24
; Using nominal kinematics.
IF FALSE THEN
swsmZuHfSpindelFahren()
swsmHfSpindelAufnehmen()
swsmHfSpindelAblegen()
...
ENDIF
END
GLOBAL DEF swsmZuHfSpindelFahren()
; ---- Setting reference (Base) ----
BASE_DATA[10] = {FRAME: X -836.064,Y -387.605,Z 500.211,A -179.840,B 0.052,C -0.898}
$BASE = BASE_DATA[10]
; --------------------------
; ---- Setting tool (TCP) ----
; TOOL_DATA[1] = {FRAME: X 0.000,Y 0.000,Z 105.400,A 0.000,B -90.000,C 0.000}
$TOOL = TOOL_DATA[1]
; --------------------------
$VEL.CP = 0.30000
;FOLD LIN P1 Vel=0.300 m/s CPDAT1 Tool[1] Base[10];%{PE}%R 8.3.42,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P1, 3:, 5:0, 7:CPDAT1
$BWDSTART=FALSE
LDAT_ACT=LCPDAT1
FDAT_ACT=FP1
BAS(#CP_PARAMS,0.300)
LIN XP1 C_DIS
;ENDFOLD
;FOLD LIN P2 Vel=0.300 m/s CPDAT2 Tool[1] Base[10];%{PE}%R 8.3.42,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P2, 3:, 5:0, 7:CPDAT2
$BWDSTART=FALSE
LDAT_ACT=LCPDAT2
FDAT_ACT=FP2
BAS(#CP_PARAMS,0.300)
LIN XP2 C_DIS
;ENDFOLD
$VEL.CP = 0.02000
;FOLD LIN P3 Vel=0.020 m/s CPDAT3 Tool[1] Base[10];%{PE}%R 8.3.42,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P3, 3:, 5:0, 7:CPDAT3
$BWDSTART=FALSE
LDAT_ACT=LCPDAT3
FDAT_ACT=FP3
BAS(#CP_PARAMS,0.020)
LIN XP3 C_DIS
;ENDFOLD
END
GLOBAL DEF swsmHfSpindelAufnehmen()
$VEL.CP = 0.02000
;FOLD LIN P4 Vel=0.020 m/s CPDAT4 Tool[1] Base[10];%{PE}%R 8.3.42,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P4, 3:, 5:0, 7:CPDAT4
$BWDSTART=FALSE
LDAT_ACT=LCPDAT4
FDAT_ACT=FP4
BAS(#CP_PARAMS,0.020)
LIN XP4 C_DIS
;ENDFOLD
$VEL.CP = 0.20000
;FOLD LIN P5 Vel=0.200 m/s CPDAT5 Tool[1] Base[10];%{PE}%R 8.3.42,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P5, 3:, 5:0, 7:CPDAT5
$BWDSTART=FALSE
LDAT_ACT=LCPDAT5
FDAT_ACT=FP5
BAS(#CP_PARAMS,0.200)
LIN XP5 C_DIS
;ENDFOLD
END
GLOBAL DEF swsmHfSpindelAblegen()
$VEL.CP = 0.20000
;FOLD LIN P6 Vel=0.200 m/s CPDAT6 Tool[1] Base[10];%{PE}%R 8.3.42,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P6, 3:, 5:0, 7:CPDAT6
$BWDSTART=FALSE
LDAT_ACT=LCPDAT6
FDAT_ACT=FP6
BAS(#CP_PARAMS,0.200)
LIN XP6 C_DIS
;ENDFOLD
$VEL.CP = 0.02000
;FOLD LIN P7 Vel=0.020 m/s CPDAT7 Tool[1] Base[10];%{PE}%R 8.3.42,%MKUKATPBASIS,%CMOVE,%VLIN,%P 1:LIN, 2:P7, 3:, 5:0, 7:CPDAT7
$BWDSTART=FALSE
LDAT_ACT=LCPDAT7
FDAT_ACT=FP7
BAS(#CP_PARAMS,0.020)
LIN XP7 C_DIS
;ENDFOLD
END
Unfortunately this is not the behavior that I need.