Hello, how do I set the interrupt, I set $PRO_ACT=FALSE?
Interrupt, I set $PRO_ACT=FALSE
-
Jozef Karas -
October 30, 2024 at 4:15 PM -
Thread is Unresolved
-
-
Hello, how do I set the interrupt, I set $PRO_ACT=FALSE?
$PRO_ACT is a system variable that shows the run status of the program interpreter. You cannot control it.
"How do I set the interrupt" is too vague to make any response to, beyond "read the manual."
-
Code
INTERRUPT DECL 126 WHEN $CYCFLAG[126] DO Your_program() $CYCFLAG[126] = NOT Your_variable INTERRUPT ON 126
When you declare a program, where you put your "DECL INT BLAH1, BLAH2..." declare your interrupt.
It's kind of annoying that the value has to go from false to true (rising edge), but using the $CYCLEFLAG structure above i found is an easy way to get what you want.
If you use the $CYCLEFLAG style, in the "Your_Program()" you need to turn the interrupt off, do what you want to happen, then turn it back on again with the:
-
GLOBAL INTERRUPT DECL 2 WHEN bIR_HALT==TRUE DO IR_HALT()
INTERRUPT ON 3
GLOBAL DEF IR_HALT()
INTERRUPT OFF 2
bIR_HALT=FALSE
BRAKE
WAIT SEC 0.8
HALT
INTERRUPT ON 2
END -
Code
Display MoreGLOBAL INTERRUPT DECL 2 WHEN bIR_HALT==TRUE DO IR_HALT() ;INTERRUPT ON 3 --Your robot code-- END GLOBAL DEF IR_HALT() ;INTERRUPT OFF 2 bIR_HALT=FALSE BRAKE WAIT SEC 0.8 HALT ;INTERRUPT ON 2 END
Doing it as described, i don't believe you need any of the INTERUPT commands.
I assume you're posting because it's not working. -
GLOBAL INTERRUPT DECL2WHEN bIR_HALT==TRUE DO IR_HALT()
INTERRUPT ON3Different numbers in statements.