Hello Robot Forum,
I am currently having a problem with the interrupt function. I a using KRC4 KR180 with KSS 8.3.22.
It seems that when I trigger the interrupt, the sub program is not called until the robot has arrived at the point it was travelling to. The interrupt should be calling the sub program immediately as the variable changes state. what is even more perplexing is that i have similar code functioning on a KRC2 and it works perfectly fine.
example code:
DEF test( )
;FOLD INI;%{PE}
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD SPOTTECH INI
USERSPOT(#INIT)
;ENDFOLD (SPOTTECH INI)
;FOLD GRIPPERTECH INI
USER_GRP(0,DUMMY,DUMMY,GDEFAULT)
;ENDFOLD (GRIPPERTECH INI)
;FOLD USER INI
;Make your modifications here
;ENDFOLD (USER INI)
;ENDFOLD (INI)
;FOLD PTP P1 Vel=100 % PDAT9 Tool[1]:Sanding Head Base[0];%{PE}%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P1, 3:, 5:100, 7:PDAT9
$BWDSTART=FALSE
PDAT_ACT=PPDAT9
FDAT_ACT=FP1
BAS(#PTP_PARAMS,100)
PTP XP1
;ENDFOLD
INTERRUPT DECL 1 when trigger1==true DO INTERTEST()
;FOLD PTP P2 Vel=100 % PDAT10 Tool[1]:Sanding Head Base[0];%{PE}%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P2, 3:, 5:100, 7:PDAT10
$BWDSTART=FALSE
PDAT_ACT=PPDAT10
FDAT_ACT=FP2
BAS(#PTP_PARAMS,100)
PTP XP2
;ENDFOLD
INTERRUPT ON 1
;FOLD PTP P9 CONT Vel=100 % PDAT11 Tool[1]:Sanding Head Base[0];%{PE}%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P9, 3:C_DIS, 5:100, 7:PDAT11
$BWDSTART=FALSE
PDAT_ACT=PPDAT11
FDAT_ACT=FP9
BAS(#PTP_PARAMS,100)
PTP XP9 C_DIS
;ENDFOLD
;If I trigger the interrupt while moving from p9 to p10, subprogram is not called until i have reached p10.
;FOLD PTP P10 Vel=100 % PDAT12 Tool[1]:Sanding Head Base[0];%{PE}%R 8.3.40,%MKUKATPBASIS,%CMOVE,%VPTP,%P 1:PTP, 2:P10, 3:, 5:100, 7:PDAT12
$BWDSTART=FALSE
PDAT_ACT=PPDAT12
FDAT_ACT=FP10
BAS(#PTP_PARAMS,100)
PTP XP10
;ENDFOLD
END
DEF INTERTEST ()
HALT
END
Display More
Any idea why this is happening?