Good evening all together,
I am new here in the forum, as well as in Kuka KRL and I have a question about Folds. As I understand it, folds are just places to collapse program code, but in my example the text in the fold has functions, see code snippet.
Code
TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO iAktPos = iKARTON_GP_VP
;FOLD PTP KARTON_GP_VP CONT Vel=100 % VP Tool[1] Base[1]:Magazin_A ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=KARTON_GP_VP; Kuka.BlendingEnabled=True; Kuka.MoveDataPtpName=PDAT1; Kuka.VelocityPtp=100; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=PTP
;ENDFOLD
$BWDSTART = FALSE
PDAT_ACT = PPDAT1
FDAT_ACT = FKARTON_GP_VP
BAS(#PTP_PARAMS, 100.0)
PTP XKARTON_GP_VP C_Dis
;ENDFOLD
Display More
Is the part after ";FOLD" a comment or no comment?
In my example the base should be switched depending on the value of the variable "iakt_Mag"
Code
; Tool und Base setzen
BAS(#TOOL,TOOL_Greifer1)
IF ( iakt_Mag == 1 ) THEN
BAS(#BASE,BASE_Magazin_A)
ELSE
BAS(#BASE,BASE_Magazin_B)
ENDIF
Do I then additionally have to change the base in the "Comment" fold as well?
Code
IF ( iakt_Mag == 1 ) THEN
TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO iAktPos = iKARTON_GP_VP
;FOLD PTP KARTON_GP_VP CONT Vel=100 % VP Tool[1] Base[1]:Magazin_A ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=KARTON_GP_VP; Kuka.BlendingEnabled=True; Kuka.MoveDataPtpName=PDAT1; Kuka.VelocityPtp=100; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=PTP
;ENDFOLD
$BWDSTART = FALSE
PDAT_ACT = PPDAT1
FDAT_ACT = FKARTON_GP_VP
BAS(#PTP_PARAMS, 100.0)
PTP XKARTON_GP_VP C_Dis
;ENDFOLD
ELSE
TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO iAktPos = iKARTON_GP_VP
;FOLD PTP KARTON_GP_VP CONT Vel=100 % VP Tool[1] Base[2]:Magazin_B ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.old; Kuka.IsGlobalPoint=False; Kuka.PointName=KARTON_GP_VP; Kuka.BlendingEnabled=True; Kuka.MoveDataPtpName=PDAT1; Kuka.VelocityPtp=100; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=PTP
;ENDFOLD
$BWDSTART = FALSE
PDAT_ACT = PPDAT1
FDAT_ACT = FKARTON_GP_VP
BAS(#PTP_PARAMS, 100.0)
PTP XKARTON_GP_VP C_Dis
;ENDFOLD
ENDIF
Display More
Thanks in advance!
LG
Luke