LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI subpanels

Hi,
 
I have a program that displays a pressure reading from a transducer but to do a test I call another vi in a subpanel but this vi stops the execution of the main vi and runs just the subvi.  Is there anyway that I can keep some of the functions of the main vi updating?  Can I get the subVI to update the main vi?  or is there a better way.
 
Thanks,
Chris
0 Kudos
Message 1 of 9
(2,948 Views)
There are couple methods you can implement this.
1. You can split the main loop into couple independent loops (not contained in any other loops). One loop will allow you to update the Main front pannel. The second loop can call the subvi and when it completes, update portions of the Main front panel.
2. You can split the functions into 3 independent VI. The main VI can communicate with the other 2 VI to extract data via queues, global variables, action engines, etc. The other two VI will run their respective function, e.g. an updating function for the Main front panel and another calling the subvi you mention.
0 Kudos
Message 2 of 9
(2,936 Views)
Gotcha,
 
I now have two independent while loops one to update the displays and controls I want to always have runing and one to call the subvi and run it in a subpanel and some other stuff.  Now, how do I keep the two while loops independent and have one stop button that will stop them both at the same time?
 
Thanks
Chris
0 Kudos
Message 3 of 9
(2,928 Views)

a local variable set to read a pointless indicator is the simplest way, but it has no other functionality.  you should look into queues or notifiers for some more robust methods.



Message Edited by JeffOverton on 06-04-2008 11:23 AM
0 Kudos
Message 4 of 9
(2,926 Views)
Wow that was fast.
 
It turns out that is exactly what I did after I submitted my reply.   First I tried to make a Local variable out of the stop button but that was not possible because of its latching so I put a dummy LED to indicate the state of the button and made that a variable.  It works great now. 
 
Thanks Guys,
 
Chris
0 Kudos
Message 5 of 9
(2,921 Views)


JeffOverton wrote:

 you should look into queues or notifiers for some more robust methods.


As Jeff mentionned, you should consider Notifiers or Queues to implement a more permanent  / robust solution.  Locals can be a quick fix, and may be quite okay as long as it is used carefully (only reading from this single Local in this case).  But for good practice, you may want to experiment with other means.
 
RayR
0 Kudos
Message 6 of 9
(2,903 Views)

Okay guys,

I took your advice and looked into the notifier and queues solution because I am all about robustified designs.  I just would like to know if I am thinking correctly.

I have two loops one that is operating alittle faster than the other.  The one that is faster (the secondary) is the loop being notified and the slower one (primary) is the one that is sending the notification.  I figured notifiers would be better because when I run a vi in a subpanel (secondary loop) my loop stops, which would load up the queue and when I actually stop, there will be a huge delay before the secondary stops.  Is this what you guys were thinking?  It seems to work good this way but is there something I may have missed here?

 

Thanks

Chris

0 Kudos
Message 7 of 9
(2,872 Views)
It sounds like you've got it worked out.  And the robustification is that you can pass the notifier reference to subvis in case they need to signal the stop, or change the notifier create to a control and make your current vi a subvi.  It's robuster.
0 Kudos
Message 8 of 9
(2,870 Views)

Using notifiers is a better way to go than Locals...  If it doesn't send data other than "Stop", then it is better than the queue.  As Jeff suggested, you can also pass the reference to sub-vi's which can make control over what should stop and when, more robust.  🙂 

RayR

0 Kudos
Message 9 of 9
(2,860 Views)