LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

launch vi from vi

Solved!
Go to solution

Pretty simple, I have one vi (main VI) that gather all the data and another vi that process the data.  I would like to have a button that once pressed opens the other VI.

 

Thanks,

 

 

 

Roddy

R&D

LV2009

 

 

0 Kudos
Message 1 of 11
(4,035 Views)
put your subvi in a case structure and than right click your subvi go to the subvi node setup and check show front panel when called
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 2 of 11
(4,030 Views)
You can also create a reference to that VI using "open VI reference" and then use an invoke mode to open FP(also in a case structure) 
Message Edited by for(imstuck) on 11-09-2009 01:36 PM
Message 3 of 11
(4,007 Views)

Roddy wrote:

Pretty simple, I have one vi (main VI) that gather all the data and another vi that process the data.  I would like to have a button that once pressed opens the other VI.



Have you tried a search? This question has been asked dozens of times. Have you looked in the LabVIEW examples? There are examples that show you how to do this.

0 Kudos
Message 4 of 11
(3,999 Views)

I actually tried to search for the answer but seems that other people wan't to do something more involve than me--I just want to press a button and open another vi.

I haven't been able to find the labview examples (I have LV2009)

 

0 Kudos
Message 5 of 11
(3,969 Views)
What happens when you go to Help>Find Examples?
0 Kudos
Message 6 of 11
(3,965 Views)
Solution
Accepted by topic author Roddy

You need to break the problem down into two parts: respond to a button, and launch a VI.

 

The first part is easy, as that involves using an event structure (assuming you have the Full Development System or higher). There are examples that ship with LabVIEW that show you how to use an event structure. Just search for "event driven".

 

The second part depends on what kind of "launching" you want to do. If you just want to pass control over to this other VI then you just need to have the subVI on the block diagram of the calling VI when you process the button event. You then just pass the data into it via the subVI's terminals. If, on the other hand, this other VI needs to run at the same time as your caller VI then you need to launch the VI dynamically using the VI server. This will launch the second VI and then return to the caller so that now both VIs will be running. You can do this using the VI Server with something like this:

 

Message Edited by smercurio_fc on 11-11-2009 12:50 PM
Message 7 of 11
(3,960 Views)

Now, one more question just in case it comes to this:

How do I do it  when the subVI is build into an application (.exe)--I already know how to strip path just in case.

 

0 Kudos
Message 8 of 11
(3,931 Views)
If you are launcing a VI dynamically then when you build an application it won't be automatically picked up to be included into the applicaiton. You need to explicitly include it in the Source Files settings page of the build specification.
0 Kudos
Message 9 of 11
(3,903 Views)

If you're starting another program that's not a VI, it's easiest to use the SystemExec to simply run a command.

(Like pressing start->run->XXX.exe-name)

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 11
(3,897 Views)