spatricks
Member
How would I make a timer that would repeat on an interval as long as a certain value is true.
IF EVENT THEN
EVENTXBIT := TRUE
ENDIF
IF EVENTXBIT = TRUE THEN
DO THIS
WAIT X MINUTES
END_IF
IF ANOTHER EVENT THEN
EVENTXBIT := FALSE
ENDIF
This is what I have so far. It counts up to 3 min and then stops, instead of resetting. I figured since I change the variable to false it should retrigger.
IF EVENT THEN
EVENTXBIT := TRUE
ENDIF
IF EVENTXBIT = TRUE THEN
DO THIS
WAIT X MINUTES
END_IF
IF ANOTHER EVENT THEN
EVENTXBIT := FALSE
ENDIF
This is what I have so far. It counts up to 3 min and then stops, instead of resetting. I figured since I change the variable to false it should retrigger.
Code:
TEST_VAR := TRUE;
TIMER_RETRIGGER_ALM0(TEST_VAR,T#3m);
IF TIMER_RETRIGGER_ALM0.Q THEN
TEST_VAR := FALSE;
END_IF;
Last edited: