LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i open front panel of a vi and run it

Hi
I have a vi that i call multiple times from another vi, however i want it to open the front panel on some calls and not on others.  What is the best way to do this?
 
I have come up with a way and was wondering if this method was okay or is there another method that might work better escepcially since i am eventually going to create an application out of it and hope that no problems pop up then
 
Unititled 1 calls Untitled 2 where with one call it opens and runs Untitled 2 while with the other call it simply runs untitled 2.vi
 
What I did was i changed untitled 2.vi window appearance to dialog but i deselected the show front panel when called, so by simply calling the subvi form untitled 1 it works.  Unititled 2 runs but does not open
 
Now with another call i want to open and run untitled 2.vi so by looking the attached vi you can see what i have done
 
Again if there is a better method that would make my vi's more efficient i would greatly appreciate it.
 
Reza Sed
 
 
Download All
0 Kudos
Message 1 of 3
(2,723 Views)
What you did, in theory, is the correct way to do it.  However, you should move the front panel open and close into Untitled2.vi and have a boolean input as to whether to show the front panel or not.  This way, your calling code is cleaner, and you don't have to reproduce the code everytime you want to call the subVI and show the panel.

If you were to use Untitled2 in another project, then you woud have to go back and look how to implement the showing of the front panel in your other code.  If later, you were to decide you want that VI to be maximized, then you make one change in the VI, and not in every place you ever call it showing the front panel.
0 Kudos
Message 2 of 3
(2,721 Views)
Thanks, will do
0 Kudos
Message 3 of 3
(2,712 Views)