Home/Support/Support Forum/how to reset an interval or delay timer in Dynamic C?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

how to reset an interval or delay timer in Dynamic C?

0 votes
I have a state machine implemented with costatements in Dynamic C. I use:
waitfor (IntervalSec(duration_of_state));
to time a state duration before switching to the next state. It is also possible to switch to the next state manually from a web page. When that happens I would like to reset the timer to execute the next statements immediately. I can't see how to do this.
asked Jan 18, 2015 in Rabbit Software by ygrignon New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

+1 vote
Add a flag that you can set external to the delay:

bypass_delay = 0;
waitfor (IntervalSec(duration_of_state) | bypass_delay);
answered Feb 3, 2015 by RonBeck62a New to the Community (19 points)
That's what I ended up doing.  I also changed the IntervalSec for DelaySec and everything works fine.  Thanks for the answer.
...