01-12-2010 03:26 PM
Hi,
In my labview project the MainVI contains about 20 subVIs. My goal is that on clicking a button on the front panel of the main VI I would like to open a particular subVI( assume it to be subVI 10). To do this in the labview development environment I used a openVI reference with its input vi path being the name of the VI i want to launch(subVI 10) and then set a true constant to the front panel to pop up the subvi front panel. This works well in the labview development environment but when I create an executable I am not able to open my subVI. I looked around on the knowledge base and found this article.
http://digital.ni.com/public.nsf/allkb/24F54CF34391074D862570E6005857DE. But this article talks about launching the front panel everytime the subVI is called. This would not work in my case as sometimes the user may not want to launch the subVI. Also I have a lot of controls and indicators on the subVI hence there is no way I can have that on the main VI as it would clutter everything on the main VI.
In the properties settings for builiding the executable, under the Source File Settings Category I can see the remove front panel option for the dependencies but it doesnt allow to set the option for the subVI individually. I can only set remove front panel for all contained items. So any help on how to address this issue is greatly appreaciated.
Solved! Go to Solution.
01-12-2010 03:48 PM
Use a property node and set the fp panel to open. See below
01-12-2010 03:59 PM
aeastet wrote:Use a property node and set the fp panel to open. See below
Errr... that sounds like exactly what the user is already doing. The problem, as I read it, is that the subVI's front panel is being stripped when built into the executable, and they want to keep the front panel.
tarunA wrote:
In the properties settings for builiding the executable, under the Source File Settings Category I can see the remove front panel option for the dependencies but it doesnt allow to set the option for the subVI individually. I can only set remove front panel for all contained items. So any help on how to address this issue is greatly appreaciated
It's true that you cannot set options for individual VIs within a folder. However, keep in mind that the folder structure in the project tree does not have to match the actual folder structure on disk. Thus, you can create a "special" folder in your project where you place these VIs that you don't want to strip the front panel, and set the properties accordingly.
01-13-2010 01:15 AM
Hi tarunA,
did you include your SubVIs in the Executable?
Cheers,
01-13-2010 01:45 AM
In your subvi call, you can edit the properties of a subi to always show front panel when called. (r-click a sub-vi in your diagram)
Or you can edit the vi's properties to always show the front panel.
The difference? In the first case it's the caller that decides if it should be shown or not (sub vi's are usually not shown), but in the other the subvi has decided to always be shown regardless of caller.
/Y
01-13-2010 02:58 AM
I suggest you don't use 'Property node' but 'Invoke node' FP.Open which you can play with the display mode.
My point of view is that you must avoid to play with general VI or project options as soon as possible because code is less readable... With Properties or Methods, you're able to check what you develop... But it's a personnal point of view 😉
01-13-2010 06:21 AM
"But this article talks about launching the front panel everytime the subVI is called. This would not work in my case as sometimes the user may not want to launch the subVI. "
Then dont call/launch the sub vi. 🙂
Or is the sub vi always running and you only want to see it at times?
/Y
01-13-2010 09:45 AM
01-13-2010 09:51 AM
@Pattos
yes i did include the sub vi in the executable.
01-13-2010 11:23 AM - edited 01-13-2010 11:30 AM
Have you tried using Static VI references instead of using "Open VI" with a file path? With a Static VI reference, the compiler has a better idea on what you are trying to accomplish at runtime.
I have done that in executables before, w/o any problem. I personally like to have a boolean input to the SubVI called "Show Window" (or something like that), and then have the SubVI handle how it wants to Open (or close) its Front Panel.
There is more than this going on.... the snippet kinda took liberties.
This is within the SubVI (which my Main VI is always running). The SubVI contains a static reference to itself. I have a button on my Main VI's front panel that when pressed sends a "True" to the "Show Window?" boolean input. The SubVI responds by openning up the front pannel. The opposite happens when the button is depressed.
This code has been compiled in many executables and works w/o any problems.
Edit: Cropped image. That boolean coming in is "First Call". The LV 2009 snippet feature made that "error out 2" terminal. Lol. I wouldn't name it that.