01-15-2013 03:37 PM
Im writing a program that when completed, could run for a very very long time. But I need a timed loop to execute every 60 secs. The two option I have come up with are these
1. Timed Loop executing every minute
2. Timed Loop executing every second, but processing the contents every minute.
First way means I can't stop the loop until the time expires (more desirable than the 2nd option), the second option relies on the ability to determine when a minute is up based upon a 1Hz iteration rate, but from what I am reading, the iteration counter will eventually get to its max value and just hold its value, while the loop continues to execute (hence I lose my logic for content execution)
I'm really hoping there is a way to do an immediate abort of a Timed Loop, but i'm not finding a way, lol
Solved! Go to Solution.
01-15-2013 03:53 PM - edited 01-15-2013 03:54 PM
If the notifier gets a error notification it passes that error to the right side error node finishing the loop untimed. Otherwise the notifier times out and passes on error to the node when you want to iterate
01-16-2013 07:50 AM
That'll work Jeff, thanks much.
01-16-2013 12:31 PM
01-16-2013 12:34 PM
Yeah, I'm seeing some random behavior I'm not quite sure about yet, but I appreciate the suggestion very much.
Thanks.
01-16-2013 01:48 PM - edited 01-16-2013 01:53 PM
For a 1 minute rate you don't need a timed loop. Why not use the timeout of an event structure and also include a second event to stop the loop immediately by breaking the timeout?
(If you also want to handle other events while keeping the timeout interval constant, see my old example posted here. See also my comment to this forgotten idea)
01-16-2013 02:01 PM - edited 01-16-2013 02:03 PM
If you want to use a timed loop, you can stop it at any time using the Stop Timed Structure tool. (even if the conditional terminal is hardwired to never stop!)
For example in the following code draft, pressing the stop button will stop and complete the timed loop immediately, no matter how long the interval is.
(Note: Configure the timed loop to get the current name, or set your own)
01-16-2013 04:28 PM
try this...
01-16-2013 04:39 PM
I think altenbach's solution is the best one...you can configure the Timed Loop to execute at the rate you want, and you don't have to worry about when the "abort check" code runs in relation to where you are time-wise in the current iteration.
01-17-2013 10:31 AM - edited 01-17-2013 10:39 AM
@Darren wrote:
I think altenbach's solution is the best one...you can configure the Timed Loop to execute at the rate you want, and you don't have to worry about when the "abort check" code runs in relation to where you are time-wise in the current iteration.
would this work immediately, whether from user input or dynamic event? rather that waiting for a 10ms iteration loop to read a "stop" as suggested by altenbach.