LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to run a subVI without poping up normally, but when clicking a button, popup the front panel?

I know pop-up the front panel of a subVi when called by selecting VI Properties>>Windows apperence.

 

But what I need to do is: always run the SubVI inside the parent VI as the nornal subVI do without poping up. But when I click a button"show front panel", the SubVI popup the front panel.

 

Is there anyway to do this?

 

Thanks,

0 Kudos
Message 1 of 5
(4,994 Views)

ossoo,

 

         You can use a static VI reference to the subVI and then use the Front Panel Open invoke method to show the front panel when you want. I have attached two VIs that show this. I saved these VIs for LabVIEW 2009 so you should be able to open them up and run them in 2009 or later. Add.VI is the subVI that you are calling. The Caller.VI is just a While Loop that contiually calls the Add subVI. Inside of the While Loop is also a Case Structure with a Static VI Reference (you might need to change the path this is pointing to after downloading the VIs to your computer for this to work) and the Front Panel Open invoke method. You can run the Caller.VI and interact with the main Front Panel as normal and see the subVI but then you can click the Open subVI? boolean button and it will open the subVI's front panel. You can continue to interact with the main front panel and see the values update on the subVI's front panel as well. You can just close the subVI's front panel when you are done viewing it. Does this helpUntitled.png?

 

 

Download All
0 Kudos
Message 2 of 5
(4,978 Views)

Hi ossoo,

 

It is quite simple to control many aspects of your VI using Property Nodes; this includes whether or not to open the front panel.

 

I've attached a simple example and some snippets.

 

Parent VI

 

Show or Hide FP.png

 

SubVI

 

Show or Hide SubVI.png


Regards,

Peter D

Download All
Message 3 of 5
(4,975 Views)

In my subVI, I have some controls like "modify", "OK" and these buttons are used for event-driven function. And "done" for stopping the while loop. But when I put this subVI inside a parent VI, I can not control these, except that open the subVI. I know the normal control for subVI.

 

But is there any way to make the control in the parent VI possible to access the controls inside the while loop in the subVI?

 

Thanks,

0 Kudos
Message 4 of 5
(4,954 Views)

You can pass control settings to your subVI while loop before its first iteration by simply 'wiring them in'.  Although you wont be able to change these until the subVI while loop completes and you come to the next iteration.  There are ways to pass variables between loops (such as local variables or queues) but these are fairly application specific.

 

Could you attach your code so we can get a better idea what's going on?

 

Pete


Regards,

Peter D

0 Kudos
Message 5 of 5
(4,927 Views)