Hi all,
KSS 8.3. and KRC4 controller
I have a seemingly basic question regarding programming an interrupt. Below is the code which I am using. My issue arises in the SLIN (0,0,0) line and then the following SLIN (0,0,0) line. If I comment out the second SLIN motion line (the bolded line), then the interrupt does not turn on and is not active. However, if I keep it in the code the robot appears to behave normally while triggering the interrupt. I figure this has something to do with my advance run pointer, but cannot for the life of me figure out what is going on. When I run the code slowly it appears to run this second SLIN (0,0,0) line several times before proceeding to the "Probe_Rough_Loc()" subroutine.
;Set current base to nominal enclosure base(5)
T = 5
BAS(#BASE,T)
T = 3
BAS(#TOOL,T)
WAIT SEC 2
;Move Z forward to z +200mm in base 5
SLIN {X 0, Y 0, Z 0} WITH $VEL.CP =0.05 C_DIS
;SLIN {X 0, Y 0, Z 0} WITH $VEL.CP =0.05 C_DIS
WAIT SEC 2
;HALT
;Set base to $NULLSPACE (world) coordinates
T = 0
BAS(#BASE,T)
WAIT SEC 2
;Probe Z distance at center of part
PROBE_ROUGH_LOC()
DEF PROBE_ROUGH_LOC()
DECL INT T
T = 5
BAS(#BASE,T)
INTERRUPT ON 1
WAIT SEC 2
$VEL = {CP 0.01, ORI1 30, ORI2 30}
LIN_REL{Z 500}
WAIT SEC 0
INTERRUPT OFF 1
END
DEF MYTRIGGER()
DECL INT T
BRAKE
T = 0
BAS(#BASE,T)
LOOP
IF (probe_pt_status == 0) THEN
PT_PROBE_ROUGH = $POS_INT
EXIT
ENDIF
IF (probe_pt_status == 1) THEN
PT_PROBE_CENTER = $POS_INT
EXIT
ENDIF
IF (probe_pt_status == 2) THEN
PT_PROBE_X = $POS_INT
EXIT
ENDIF
IF (probe_pt_status == 3) THEN
PT_PROBE_XY = $POS_INT
EXIT
ENDIF
ENDLOOP
T = 4
BAS(#BASE,T)
RESUME
END