Hello there,
KRC4 , kuka OPC V8.3.21 HF1 , KR240 , workvisual 4.0.26
In one of my program, I'm using "trigger when distance" to keep track of which point has been reached by the robot.
$advance = 2
TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO programStepNbr=programStepNbr+1
;FOLD PTP P1 CONT Vel=50 % PDAT1 Tool[12]:CNThandling Base[1]:WORLD;%{PE}%R 8.3.38,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P1, 3:C_DIS, 5:50, 7:PDAT1
$BWDSTART=FALSE
PDAT_ACT=PPDAT1
FDAT_ACT=FP1
BAS(#PTP_PARAMS,50)
PTP XP1 C_DIS
;ENDFOLD
;STEP 6 MOVE TO FRONT CNT 2
TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO programStepNbr=programStepNbr+1
;FOLD PTP P2 CONT Vel=50 % PDAT0 Tool[12]:CNThandling Base[1]:WORLD;%{PE}%R 8.3.38,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P2, 3:C_DIS, 5:50, 7:PDAT0
$BWDSTART=FALSE
PDAT_ACT=PPDAT0
FDAT_ACT=FP2
BAS(#PTP_PARAMS,50)
PTP XP2 C_DIS
;ENDFOLD
;STEP 7 MOVE TO FRONT CNT 3
TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO programStepNbr=programStepNbr+1
;FOLD PTP P3 CONT Vel=50 % PDAT0 Tool[12]:CNThandling Base[1]:WORLD;%{PE}%R 8.3.38,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P3, 3:C_DIS, 5:50, 7:PDAT0
$BWDSTART=FALSE
PDAT_ACT=PPDAT0
FDAT_ACT=FP3
BAS(#PTP_PARAMS,50)
PTP XP3 C_DIS
;ENDFOLD
Display More
But, when doing like this, the variable programStepNbr is only incremeted once when the robot reaches P3.
The only way I could make it work was to change TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO programStepNbr=programStepNbr+1 by TRIGGER WHEN DISTANCE = 1 DELAY = 0 DO programStepNbr=7 , 8 , 9 and so on.
I suspect it'is due to the advance run (again). Is there an explanation why ?
Also, sometimes it can happen that 2 following points have the same coordinates (because while programming we put more points than necessary to create the trajectory). How will the "trigger when distance" behave?
Thank you in advance