LabVIEW

cancel
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.

kls
0 Kudos
Message 1 of 4
(1,465 Views)
As I understand you have a VI named First.vi and need to launch(Pop Up) it when Second.vi is executed.
In LabVIEW there is a concept of SubVIs where you can call subtasks.
So you will have to insert First.vi in Second.vi and set the 'VI Properties' of First.vi 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 http://www.ni.com/white-paper/7593/en/
GCentral
0 Kudos
Message 2 of 4
(1,433 Views)
  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: http://www.ni.com/tutorial/7595/en/

Some more guides for beginners here: http://www.ni.com/newsletter/51735/en/

Learning material links here under "Looking for free training": https://decibel.ni.com/content/docs/DOC-40451

0 Kudos
Message 3 of 4
(1,431 Views)

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

kls
0 Kudos
Message 4 of 4
(1,395 Views)