LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

open subvi front panel in executable

Solved!
Go to solution

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.

0 Kudos
Message 1 of 14
(12,258 Views)

Use a property node and set the fp panel to open. See below

 

Example.png

Tim
GHSP
0 Kudos
Message 2 of 14
(12,248 Views)

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. 

0 Kudos
Message 3 of 14
(12,235 Views)

Hi tarunA,

 

did you include your SubVIs in the Executable?

 

Cheers,

Pattos

LabVIEW Gretchin
0 Kudos
Message 4 of 14
(12,217 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 14
(12,210 Views)

I suggest you don't use 'Property node' but 'Invoke node' FP.Open which you can play with the display mode.

 

InvokeNodeOpenVI.jpg 

 

 

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 😉

0 Kudos
Message 6 of 14
(12,196 Views)

"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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 14
(12,176 Views)
yes the sub vi is always running but i want to only see it some times( this is dependent on the user, i want to give the user complete control on when to view the front panel )
0 Kudos
Message 8 of 14
(12,164 Views)

@Pattos

 

yes i did include the sub vi in the executable.

0 Kudos
Message 9 of 14
(12,162 Views)
Solution
Accepted by topic author tarunA

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.

 

original_2.png

 

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.

Message Edited by Nickerbocker on 01-13-2010 10:30 AM
Message 10 of 14
(12,147 Views)