LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a VI from another VI

Hi,

 

I am new here. I was wondering if there was a way to open a VI from another VI. So for example, I have 5 buttons on a VI that references to 5 other types of VI's. I want to be able to go to the Main.vi just click on "File 1" button, and file1.vi would open. I tried using SubVI's but for some reason the outputs of my file1.vi, file2.vi . . . stay on the Main.vi. All I want on the Main.vi are the buttons, and the individual files will display everything else. I would really appreciate if someone could help me out with this.

 

Thanks

omss 

0 Kudos
Message 1 of 12
(24,791 Views)
Take a look at the examples for subpanels. That should accomplish what you want.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 12
(24,787 Views)

Where would I find example discussions? This forum is quite confusing to navigate. Search functions aren't helping me either.

 

Thanks

0 Kudos
Message 3 of 12
(24,779 Views)
The example finder is in the Help menu of LabVIEW.
0 Kudos
Message 4 of 12
(24,772 Views)

hiii...

you can use event structure to track event on any button and then depending on that can open another vi as a sub vi.

for that use the sub vi node setup on right clicking the sub vi icon and check open front panel when called option.

this will show you front panel of another vi.

 

you can have a look at following vi's

 

may be this will help you.

 

cheers.....

Download All
Message 5 of 12
(24,756 Views)
And if you dont want to keep them as subvis even, and directly want to specify the path of the VI you want to open , then look at this
Somil Gautam
Think Weird
Download All
Message 6 of 12
(24,741 Views)

In general sub-vi's try to stay closed. To pop it up, you'll need to either:

1. change the vi's properties to always show front panel

2. pop the front panel through properties in the code

3. Change the sub-vi call in main.vi through Call setup.

 

I prefer solution #3. Just r-click your sub-vi, Call Setup, and "Show Front panel when called".

 

Unless i misunderstood that should solve it, no?

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 12
(24,703 Views)
This is another way you can open a VI from another VI.
Message 8 of 12
(24,652 Views)
Would it be possible to open a VI from a drop down menu? 
0 Kudos
Message 9 of 12
(24,595 Views)

Hi ahamel,

 

it doesn't matter how you select the VIs, you will have to use some sort of case structure anyway...

 

So: Yes, you could use a drop down menu too.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 12
(24,590 Views)