LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the wait command

There is a feature on Lab View that allows you to wait for front panel activity, but it is for that vi's front panel.  If I wanted to wait for activity on a sub view front can I also use that function and change the properties or is there a way to wait for a sub vi's front panel activity using another function?  I have a while loop and within that while loop I have another while loop and a for loop.  There are some conditions within the smaller while loop that causes a sub vi to open.  Whenever the sub vi opens it prompts the user for a command, and the smaller while loop do not continue executing into the sub vi closes.  But when the sub vi opens the for loop continue to run.  How can I make it so that the for loop pauses whenever the while loop pauses and can I use the wait for front panel activity function to do that?
0 Kudos
Message 1 of 3
(2,714 Views)
How about using an event structure and making it wait on a mouse down event?
0 Kudos
Message 2 of 3
(2,708 Views)
A simple solution is to use a local variable of a boolean indicator in the while loop that is switched off when the sub vi is opened, and on when the sub is closed. Place another while loop inside the for loop, with the stop condition connected to the local. Don't forget to put a raisonable timing delay in this waiting loop.
Chilly Charly    (aka CC)
0 Kudos
Message 3 of 3
(2,706 Views)