LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you open a vi programamtically?

Hi

When the user presses a button, the vi should open. How do you do this?
Thank you.
0 Kudos
Message 1 of 5
(2,821 Views)
You can use the "Open VI Reference" function, and then set the VI's "Front Panel Window::Open" attribute.
0 Kudos
Message 2 of 5
(2,821 Views)
Hi adrian,

if the VI is a sub-VI then in the sub-VI go to VI Properties >> Window apperance. Here you can set attributes regarding to the window.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 3 of 5
(2,821 Views)
Help menu > Examples..> Advanced > Customizing Controls and VIs > VI Properties Exmaples

You will find useful information from the above path.
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 4 of 5
(2,821 Views)
There are a couple ways to do this.

The first would be to set the VIs properties so the front panel opens when called (VI Properties>Window Appearance>Customize>Show Front Panel When Called) and Run When Opened (VI Properties>Execution>Run When Opened). Then place the VI in a Case Structure and have the button switch to the Case with the VI in it to open and run it.

The better way would be to use Invoke Nodes. Follow the steps below to set it up.


  1. From the Functions palette, drop an "Open VI Reference" function from the "Application Control" menu.

  2. On the "vi path" input, build a path the VI you want to open.

  3. On the "VI Reference" output, right click and navigate the menu to "Create > Property > Front Panel Window > Open". C
    onnect the "VI Reference" output to the "Reference" input of the property node. Right click on the property node and select "Change All to Write". Create a True boolean constant on the FP.Open attribute.

  4. On the "Duplicate VI Reference" output of the property node, right click and navigate the menu to "Create > Method > Run VI". Connect the VI Reference terminals. Here you'll have to make a decision. The "Wait Until Done" attribute will cause your main VI to stop executing until the called VI is closed. If you have LabVIEW 6.1 or 7, the "Auto Dispose Ref" attribute will automatically close the VI reference for you. Any other version and you'll need to drop a "Close Reference" function from the "Application Control" palette to clean up the reference.


Using the references is far more flexible since you can input any VI path and open any VI with the same bit of code. The first method would have to repeated for every VI that you need opened.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 5
(2,819 Views)