LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallel While Loops, One Triggered by Boolean

I have a situation shown very simply in the attached picture. I have two While Loops that I want to run uninterrupted in parallel, but for the second one to only start running when a button is pressed. Adding a Case Structure around the second While Loop and attaching it to the button does work. The actual application of this is a subvi pop-up, which contains its own while loop and shows on button press, running alongside a main vi. But hopefully the simple picture solution will be the same. Any ideas? Thanks.Capture.PNG

 

 

0 Kudos
Message 1 of 4
(2,205 Views)

So, some questions:

  1. You say the case you're trying to solve is a pop-up subVI with its own While loop. What should happen when the boolean is false? Does the loop pause, or is it just that the subVI is invisible/hidden?
  2. Is there any data dependency between the two loops?
  3. Are you running this on a PC?

GCentral
0 Kudos
Message 2 of 4
(2,188 Views)

All you need is a single outer while loop. Put the code that should not always run into a case structure.

0 Kudos
Message 3 of 4
(2,181 Views)

Sounds to me like you should be using the Asynchronous Call By Reference to run the VI when that button is pressed.  This way the VI will run in parallel with your main loop and will only be loaded when it is needed.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,156 Views)