Showing results for 
Search instead for 
Did you mean: 

Open and close vi`s

I am working on 2 vi. files where one perform hardware check, closes it selv and start a new vi file.


How do I do that?


First vi.      - Hardware check and self-calibration if needed.

Second vi. - Main program using the hardware first vi. checked.

0 Kudos
Message 1 of 4
As I understand you have a VI named and need to launch(Pop Up) it when is executed.
In LabVIEW there is a concept of SubVIs where you can call subtasks.
So you will have to insert in and set the 'VI Properties' of as a dialog (But make sure to program is in such a way that it will closes after completion of execution.
Otherwise you can refer to
0 Kudos
Message 2 of 4
  1. Please next time do not post a VI which has setting as "Run when opened". It is just silly, anyway, you should use LV project, and create an executable (exe) from your applicaton for final use.
  2. Your VI is a nice example how to abuse an Event structure:
    1. You should have the controls inside the corresponding Event cases
    2. The timeout is not needed if you make a proper design
    3. The Flat Sequence Structure is not needed
    4. That lots of "REinit To Default" invoke nodes could be replaced by a single one, just use the reference of your VI (actually this one is not needed when you use an EXE, as you should!)
  3. I really recommend you to learn how to use a State Machine in this case. You do not need a VI to close another VI. An example how to design a State Machine for your application, imagine the following states:
    • Init (load latest settings done by user from configuration (.ini) file)
    • HW check
    • HW calibration (optional)
    • Idle state (wait for user commands)
    • Start DAQ
    • DAQ
    • Stop DAQ
    • And so on.......

A very basic example of state machines here:

Some more guides for beginners here:

Learning material links here under "Looking for free training":

0 Kudos
Message 3 of 4

Tnx Blokk, I will take a look at this and try it out.

0 Kudos
Message 4 of 4