LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you get two VI's to start and run simultaneously?

I have two VI's that I need to start and run at the same time. I want one to run for a specified length of time while the other does a variable number of iterations. Right now, both VI's complete one iteration before the one VI repeats, but I'd like to have that one repeating while the other runs continuously. Is this possible?
0 Kudos
Message 1 of 8
(3,870 Views)
In general, yes...However, problems can arise if the two VIs use a lot of the same subvis. Unless it is configured to be reentrant, a VI can only be executing in one place at a time. Hence, the one could be waiting for a subvi in the other routine to become available.Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(3,870 Views)
I don't think there should be any conflicts with the two VIs trying to run the same subVIs. In that case, how do I go about getting the two VIs to run at the same time?
0 Kudos
Message 3 of 8
(3,870 Views)
Open a reference to each of the VIs. This loads the VI into memory. Then use this reference for a invoke node and set it to "Run VI". Be sure to connect a FALSE to "Wait until done". This will start your VI as you would do it with CTRL-R or the run button. After your work close the reference to the VI. This will unload the VI from memory.
Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 8
(3,870 Views)
How do you open a reference to each of the VIs?
0 Kudos
Message 5 of 8
(3,870 Views)
In the "Application control" palette is a function named "Open VI Reference". You must connect a wire of type path to the function because you will load the VI from the file system. A string only works if the VI is already loaded.
Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 6 of 8
(3,870 Views)
There are also several examples shipping with LV that demonstrate the process.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(3,870 Views)
Do I need the "Open VI Reference" in both VIs or just one? Do I need any loops or anything to contain the invoke node? I am pretty new to LabView, so could you just explain a little more fully how I can make this work? Thanks. I am attaching the two VIs I need to start and run at the same time. I just need these two to start simultaneously and run at the same time, but they should loop independently of each other. Thanks for any help.
Download All
0 Kudos
Message 8 of 8
(3,870 Views)