LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a VI to run and closing the caller VI

Good day to all

 

what I wanted to ask is:

lets say I'm running a VI who is calling another VI.

now I want to close the first one and leave the second one running.

can it be done? and if so how?

 

thanks

shai

0 Kudos
Message 1 of 7
(3,440 Views)

Use the VI Server to launch another VI. E.g.:

 

 

 

In your case you would set a False for "Wait Until Done". This will spawn the VI on its own. Your parent VI can simply close itself once it finishes. 

Message 2 of 7
(3,430 Views)

If you are creating an executable to do this, you need to make sure the second VI is up and active before closing the original VI.  The easiest way to do this is to poll for the second VI's run state while in the first VI after launching the second VI (a 50ms to 200ms interval is plenty fast enough).  When the second VI is running top-level, it is safe to close.  You can also use other communication mechanisms such as queues.

 

Why do you care?  The run-time engine continuously checks to see if there is a VI running top level.  If not, it exits, taking all running VIs with it.  If you exit the first VI before the second gets up, the run-time engine will close.

Message 3 of 7
(3,396 Views)

When calling a VI to run and giving him the parameters to run by how can i make it run on full screen (and not in the background)?

 

0 Kudos
Message 4 of 7
(3,300 Views)

You can use a Property Node and select the properties for FP.IsFrontMost and FP.SizeToScreen and wire a value of TRUE to both of them.

 

R

 

Message Edited by JoeLabView on 10-16-2008 09:08 AM
0 Kudos
Message 5 of 7
(3,283 Views)
Where do i find those functions and how do i pass the parameters to the VI?
0 Kudos
Message 6 of 7
(3,269 Views)

That's a property node. What I had shown in my example is an invoke node. You will need to learn about property nodes and invoke nodes which can be used to act on specific LabVIEW classes, such as VI references and control references. You can learn about these in the LabVIEW Help and in the examples that ship with LabVIEW. For control references you can take a look at this: Control References: Overview. For a VI the same concepts apply, except you just have a different list of properties and methods.

 

To pass values to a VI that you call dynamically you therefore have to use the appropiate methods, like in this example:

 

 

To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

 

 

Message Edited by smercurio_fc on 10-16-2008 09:15 AM
Message 7 of 7
(3,264 Views)