comp.lang.labview - Labview Software Discussion Group.
There is a stop button on my main vi and the boolean value could be passed to subvi using control reference. So the subvi could stop when the stop button on main vi's front panel is pressed. My question is how I can pass that boolean value to nested subvi, so once the stop button in main vi is pressed, all nested subvi stop? Thanks.
Hi, You have to run it dynamically, with the Run VI method. This method can optionally wait or not. Before running the VI, you have to set the controls with the method Set Control Value (or Set Control Value [Variant]). There are several ways to read back values from dynamically started VI's. One is to use a buffer (lv2 global). Another is to use the Get Control Value method. It's complicated, but if you put all this code in a sub vi, you'll end up with a nice main... Regards, Wiebe. "smal" < XXXX@XXXXX.COM > wrote in message news: XXXX@XXXXX.COM ... > Hi > I wanted to run a subvi each time the user pushes a button. > So the subvi might be called multiple times & different instances of > the subvi run simultanously with their front panels open. > To do this I made a .vit & call it by refrence wehenever a button is > pressed but it doesn't work.For the first time it opens but it seems > as if the .vit doesn't return after it is called. while if I use the > same method & call the .vit by reference 2 times in parallel both of > the front panels open without problem. > > How can I solve this problem(the main & the subvi are attached LV > 7.0). > > Thanks for your attention in advance
Lihui: From your sub-vi, you can et Control Value?of a Boolean idebutton?(just for the lack of better names) in main.vi to true using vi property node. (Or you can also write to a global variable that can be accessed in main.vi) In the main.vi, you can wire it to a case structure (or better yet to a dynamics events structure in LabVIEW 7.0), which has the property node/visible set to false inside it. When Boolean hide button is set to true, you will be able to hide the button. You could set visible to true in when boolean "hidebutton" is false as well if it's convinient for you I hope this helps, FightOnSCTrojan