From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-01-2015 02:45 PM
I have a timed loop which is set to execute once every hour. I would like add the option to force the loop to execute on a button press, and then reset the timer to an hour from when the button was pressed. I can't seem to find any way to make the timed loop do this, though. Obviously I could just copy the contents of the loop into a separate event structure, but there must be a more elegant way. Can anyone give me a hand?
Thanks.
Solved! Go to Solution.
05-01-2015 02:53 PM
05-01-2015 02:54 PM
What happens inside the timed loop?
You need to have another loop that will allow the timed loop itself to repeat.
Normally, you'd have code inside a case structure that executes whenever it gets a True from something like the Elapsed Timer Express VI. You would just need to OR that with the button you are pressing to force the timed loop code to run early.
Post your VI so we can see what you are doing.
05-01-2015 02:54 PM
If you are in Windows, you should not be using a Timed Loop anyways. Too much overhead for very little in return.
If you do not want to add the code to your event structure, then make a seperate loop with a Queue. The timeout for the Dequeue should be your 1 hour. Your normal event driven loop and enqueue an element to tell this other loop to run.
05-01-2015 03:16 PM
Thanks all, this solved my issue.