LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run same vi multiple times simultaneously

Hi,

 

First post here on the forums and I was curious if someone could help me out with a problem I have been searching on for a while now.

I'm making a project for calculating GPS location based on an incoming signal. This signal is analyzed to see which satellites are in view. Now for every satellite in view the signal should be analyzed further with different parameters. I have a subVI for this, which takes these parameters and calculates the data the satellite has sent. For one satellite this works. I have to do this for every satellite in view though, and calculation time is very much a concern. This is why I would like to let the subVI run simultaneously for the different satellites. Also, this subVI has a feedback node in it, as it uses data from the previous analysis of the signal for that same satellite. Every time the subVI is called for this satellite it needs to take the correct parameters from the previous analysis of this satellite.

 

I have been trying to make this work, but didn't have any success yet. How can I make the subVI's run simultaneously, though without interferring with eachothers data and eachothers feedback nodes?

 

Any ideas or help are very much appreciated.

 

Tim

0 Kudos
Message 1 of 20
(4,857 Views)

Maybe you should make the subVI reentrant.

0 Kudos
Message 2 of 20
(4,823 Views)

I did indeed try to do that. It seems that the feedback nodes still interfere with eachother, that's how it looks to me anyway. Also, do I just have to copy this VI the amount of times I want to run it at the same time and just call them all at once then?

 

Thanks for your answer.

0 Kudos
Message 3 of 20
(4,814 Views)

You probably need to be a bit more specific. Can you show us some code on how you call them? Are all calls from seperate instances in the calling code?

0 Kudos
Message 4 of 20
(4,809 Views)

I would like to call all the subVIs (VI1) (all identical) that handle a signal from one satellite from one VI (VI2). This VI2 provides every copy of VI1 with the correct parameters for a certain satellite. VI2 is called in a loop in the main VI (VI3). So: VI3 provides a part (a certain amount of samples) of the main signal to VI2, VI2 sends that signal to different copies of VI1 together with some parameters, VI1 calculates one bit of data from the signal for one specific satellite (satellite number and other properties are in the parameters sent by VI2). VI2 takes all the bits from the different copies of VI2 and puts them in an array. It then sends this array to VI1. This array represents all the bits sent on one specific moment for all the satellites that were treated. The loop in VI1 makes sure this whole process is called for every new amount of samples collected.

 

I hope my explanation is clear enough for you to help me find a solution.

0 Kudos
Message 5 of 20
(4,797 Views)

If VI1 is reentrant, each instance should have its own dataspace. What makes you think they intereact?

0 Kudos
Message 6 of 20
(4,790 Views)

It may work now. I'll do some more testing tomorrow (as it is past midnight over here), and confirm everything works correctly. Could it be I copied (literally copy-paste) a clone of VI1, which made it share it's dataspace anyway?

0 Kudos
Message 7 of 20
(4,783 Views)

@Wonano wrote:

Could it be I copied (literally copy-paste) a clone of VI1, which made it share it's dataspace anyway?


No, that would not cause a problem.

0 Kudos
Message 8 of 20
(4,766 Views)

Be aware that any non-reentrant code in your reentrant VI will cause waits as the requests for the non-reentrant code queue up.  This will cause all of the instances of your reentrant VI to wait on each other, almost as if they weren't reentrant.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 20
(4,754 Views)

I had an application where I wanted to record the behavior of mice while recording video clips during specific behaviors.  We had 24 "stations", each with a camera and other equipment. We wrote a system to handle one station, made it a pre-allocated reentrant clone, then spawned up to 24 of them (depending on how many animals we were running).  Note that "spawn" means that we ran them as detached parallel processes using Start Asynchronous Call.  Worked fine.

 

BS

0 Kudos
Message 10 of 20
(4,735 Views)