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-13-2012 10:27 AM
I would like to have a timed loop and an event loop running simultaneously. Is there a simple, clean way of doing this? (i.e. without hideous queues, etc.) My attempt is shown below. Unfortunately, as soon as the timed loop starts, the event loop becomes unresponsive. Thanks for your help!
Solved! Go to Solution.
05-13-2012 11:43 AM
You have a data dependency and the outer loop cannot complete until everything in it has completed.
@ishmael wrote:
I would like to have a timed loop and an event loop running simultaneously. Is there a simple, clean way of doing this? (i.e. without hideous queues, etc.)
You could use a regular queue. I would recommend against hideous queues, even though I don't quite know hat that would be. :D)
In order for the event structure to be ready at all times, it needs to be in its own loop.
(Nobody likes to write examples from scratch, so please attach your code so someody here can maybe try to modify it).
Also please be more specific about the purpose of your code. What is is actually supposed to do?
05-13-2012 11:47 AM
Try put the button start/stop inside the while loop and replace signal of button with NewVal, the event case will work and the control refresh your status when run.
regards
05-13-2012 11:49 AM
Thanks for the reply, altenbach. I've attached my VI - sorry about that. All I'd like my code to do is allow for a timed loop to be started or stopped with the click of a button. In my sample code, when the timed loop is running, it should just display an increasing loop count.
05-13-2012 12:22 PM - edited 05-13-2012 12:37 PM
You don't need the outer loop. Place the event structure inside the timed loop and manipulate the timeout between zero and infinite, depending on the desired state.
05-13-2012 12:35 PM
That's great, thanks! It works perfectly, although intuitively, I would have thought that the event loop would not run until after the timed loop was already running. In any case, this is elegant and simple. Thank you.
10-16-2013 08:44 AM
Can someone please downconvert the file to version 10.1?
Thank you in advance.
10-16-2013 09:04 AM
@AnoAno wrote:
Can someone please downconvert the file to version 10.1?
Here you go....