I am trying to write a simple search interrupt that stops motion when an input is received and record the point, then go to an offset of that point. See code below.
I am unable to get the interrupt to trigger and stop the robot. I have verified that 1041 is the correct input and that the input is not on when the interrupt is turned on. If anyone has any ideas as to why this would be the case it would be appreciated.
Code
DEF PICK ( )
PTP HOME
INTERRUPT DECL 5 WHEN $IN[1041]==TRUE DO SEARCH_FOUND ()
PTP PSEARCH_START
SEARCH_MOTION ()
LIN PSEARCH_FOUND
PTP HOME
END
DEF SEARCH_MOTION ( )
INTERRUPT ON 5
LIN PSEARCH_END
WAIT FOR TRUE
INTERRUPT OFF 5
END
DEF SEARCH_FOUND ( )
INTERRUPT OFF 5
BRAKE
XPSEARCH_FOUND = $POS_INT
XPSEARCH_FOUND.Z = XPSEARCH_FOUND.Z - 500
RESUME
END
Display More