Hello, I'm trying to write an interrupt program that when an input is detected as true it will stop the robot, once the input is then detected as false it will hop back to the main program where the interrupt was called and start from a chosen point ("return Point")
the code is quite simple as I'm juts trying to test it our before I add it into active production
Main Program: INTERRUPTTEST ()
Interrupt Program: SOFTSTOP ()
Once SOFTSTOP () is Finished i want it to start up at the "RETURNPOINT" in INTERRUPTTEST ()
I've tried looking into GOTO and potentially using CWRITE but I'm not sure what to do from here.
I'm still quite new to writing in KRL so if there's anything you can do to help or push me in the write direction that would be much appreciated.
DEF INTERUPTTEST( )
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
INTERRUPT DECL 10 WHEN $IN[17]==TRUE DO MOVEASIDE()
INTERRUPT DECL 11 WHEN $IN[18]==TRUE DO SOFTSTOP()
LOOP
INTERRUPT ON 10
INTERRUPT ON 11
;"RETURN POINT"
SPTP XP1 WITH $VEL_AXIS[1] = SVEL_JOINT(50.0), $TOOL = STOOL2(FP1), $BASE = SBASE(FP1.BASE_NO), $IPO_MODE =
SPTP XP5 WITH $VEL_AXIS[1] = SVEL_JOINT(75.0), $TOOL = STOOL2(FP5), $BASE = SBASE(FP5.BASE_NO), $IPO_MODE =
SPTP XP6 WITH $VEL_AXIS[1] = SVEL_JOINT(75.0), $TOOL = STOOL2(FP6), $BASE = SBASE(FP6.BASE_NO), $IPO_MODE =
SPTP XP7 WITH $VEL_AXIS[1] = SVEL_JOINT(75.0), $TOOL = STOOL2(FP7), $BASE = SBASE(FP7.BASE_NO), $IPO_MODE =
$ADVANCE=3
INTERRUPT OFF 10
INTERRUPT OFF 11
ENDLOOP
END
Display More