11-09-2009 10:52 AM
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
Solved! Go to Solution.
11-09-2009 11:07 AM
11-09-2009 01:34 PM - edited 11-09-2009 01:36 PM
11-09-2009 01:58 PM
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.
11-11-2009 12:34 PM
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)
11-11-2009 12:41 PM
11-11-2009 12:50 PM - edited 11-11-2009 12:50 PM
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:
11-12-2009 04:19 PM
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.
11-12-2009 11:22 PM
11-13-2009 01:43 AM
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