LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I open a VI as an independent program out of an other program?

I have two vi's. In the first VI I want to make configurations and after that I want to start an second VI out of the first VI with an simple "OK" Button.
0 Kudos
Message 1 of 5
(3,176 Views)
The easiest way to do that is to use the event structure (7.0). and edit the events of the structure to handle the OK button. If you do not have a version of labview that has the event structure capability, then you can use a statemachine. Look at the examples for further info. I'll try to attach an example VI later if you need one.

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 5
(3,176 Views)
I don't see why it needs an event structure... the simplest way is to make one VI a subVI of the other (it is up to you which way round), use the Front Panel Visible properties of the two VI's to control which one is visible at which time, and use dataflow to ensure that the functions of the main VI only execute after the configuration VI has finished. Assuming the configuration VI displays a panel of settings for the user to adjust, you are going to have to use some kind of structure to ensure you read the latest values of these when the OK button is clicked, so you might as well make it a while loop that also polls the OK button.
0 Kudos
Message 3 of 5
(3,176 Views)
tmh

there is no need to do polling if he uses the event structure. Polling takes up processor the event structure, saves processor time for something else because it waits for that one event to happen. I agree event structure is probably overkill but it is easy to learn how to use and will let his application be more robust.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 4 of 5
(3,176 Views)
User VI server, under "Application Control", to load and run the second VI. This way the original VI can exit after the second VI is running. For examples, goto "Help -> Find examples" and search for VI server.

-Joe
0 Kudos
Message 5 of 5
(3,176 Views)