This sounds like the perfect situation for the "Selective GUI Panel Control" technique, whereby all the subVIs can remain embedded in a *single* ( -- Michael, you'll like that one ;�), active loop, and the GUI panels open and close without any impact to the underlying code. All of the GUI subpanels VIs can live inside the single loop architecture without the typical wireflow complications of nested while loops -- that is, 'outer' main VI loops waiting on the completion of 'inner', subVI (GUI) loops.
Another one of the great advantages of this method is that it can usually be applied to existing architectures without the usual hair-pulling, gnashing of teeth, and major reconstruction required by changing the application's underlying architecture midstream. (In fact, this is precisely how I stumbled onto it myself...)
There isn't room to discuss the concept in any detail here, but if you are curious, there are 20 pages or so dedicated to the technique in "LabVIEW GUI" (including a variety of real-world, practical examples -- more info here: http://www.bettervi.com/LV_GUI/LVGUI_Gen.html )
On the other hand, if you don't want to spring the 50 or so bucks for a book, check out the LTR back-issues for two articles on the technique. (Intro article: Vol. 8 No. 2, and an application to Error Handling: Vol. 8 No.3. More info can be found at www.ltrpub.com)
Not only does your situation sound like the ideal application for this particular technique, but once you get a handle on the underlying concept (and the apparent reversal of LabVIEW GUI logic implied by it), you are sure to find other interesting uses for this handy, and (dare I say it?) powerful, wiring strategy.
Cheers,
Dave Ritter BetterVIEW www.bettervi.com
Yes, it will work. Go right ahead.
My problem is I enjoy discussions on methodology and implementation techniques too much. In our local LabVIEW user group meetings we
sometimes (actualy always) discuss (actually argue) programming style. The issue lately is: single loop good, multiple loops bad.
:-)
Michael Aivaliotis <http://forums.lavausergroup.org>
Couldn't I put the subvi's in a true case and nothing in the false case within the separate while loops? Control the case using a local (....aaaah, that bad word again) from the state machine.
Maybe it is not best programming style, but would be quick to implement in this existing project....
Gerd
How do you suggest that the subvi's get called? What method would you use to command the subvi's from the state machine? Just curious...
Michael Aivaliotis
Gerd,preferable, I think
You asked,
...The main VI is basically a state machine waiting for userclicks togo to one of the sub VIs, which e.g. displays a xy chart of measurements... How can I get the main VI to commence working (not waiting for the chart window to complete and return)?
Michael responded,
You will have to use VI Server to do this...
While Michael's approach will work and is probablymachine loop.you might also accomplish the same thing by putting each of your selectable subVIs in its own loop parallel to the stateUse the state machine to enable the execution of theappropriate subVIincluding thefor one iteration of the subVI's loop. One loop being held up until its subVI closes will not interfere with any other loop,master state machine's.
-- EnWirementally, Paul F. Sullivan
