LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically creating parallel loops

Solved!
Go to solution

Hi

 

I have a VI which i want to call a number of times defined by the user. so i can simply put the vi in a for loop and call it accordingly.

 

now each time the vi is called, it executes data independently of the previous call. Hence i want to run them in parallel using reenterant subvi property.

 

However the no of times a vi needs to be called can be determined only during run time..

 

How do i do this?.. hope i have made my question clear

 

thanks in advance

0 Kudos
Message 1 of 4
(3,077 Views)
Solution
Accepted by topic author Ujjval Shah

What does the subVI do? Is it supposed to run continuously? Does it have a loop? If so, then you should launch the VI using the VI Server functions. This allows you to launch the VI and then go to the next iteration of the loop to launch a new instance.

 

Check the examples that ship with LabVIEW on using the VI Server to launch VIs dynamically. You will also find numerous examples in this forum. 

0 Kudos
Message 2 of 4
(3,066 Views)

Hi smercurio_fc,

 

Thanks for your reply.

I tried using VI server reference.

 

The subVI has a for loop inside it

 

However i am not getting the desired result. According to what you said, using the vi server reference in a loop should launch the subVI  and move on to the next iteration and then call another clone of the subVI- correct me if i misunderstood-.

and if i understood correctly then this is not happening cause LabVIEW is waiting for this called subVI to execute completely and then only it moves on to the next iteration. I want multiple instances of the same VI to run in parallel

 

initially i thought it might be a problem of the subVI being non-reeenterant, but even after making it reenterant, i am having the same problem.

 

pls share your thoughts and help me.

 

Thanks 

0 Kudos
Message 3 of 4
(2,958 Views)

ok, i just figured it out.

 

the example of multiple pop ups came into handy.

 

Thanks!

 

problem solved 

0 Kudos
Message 4 of 4
(2,946 Views)