NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a second instance of the same VI?

Solved!
Go to solution

Hi,

 

I have a useful VI dealing with the IO operations.To save some time I'd like to call the VI as a second instance to do some work paralelly. I created a sub sequence with the execution option 'Use new thread' and I called the Vi (one step in the sequence only). Time of execution of the VI is about 20sec. Durin the execution I called the sub-sequence and I carried on executing my main (parent) sequence. Since 10 seconds from launching the subsequence (in the sepatate thread I called the same VI as in the sub-sequence thinking the secon instance will be created. However, instead of paralell work of the two instances of the same VI I had to wait when mt sub-sequence will finish th efirst call of the VI.

 

So my question is as in the subject:How to call a second instance of the same VI in 'the same time'?

 

Could you please advise me about the best approach to solve the problem?

0 Kudos
Message 1 of 5
(4,228 Views)
Is the VI set to allow reentrant execution (VI Properties > Execution)?
Message 2 of 5
(4,226 Views)

Your VI needs to be Reentrant. You'll find that option in the VI Properties dialog.  Search the LabVIEW help for more information.

 

Keep in mind though, that most IO devices only allow one active connection at a time, so even if your VI is running asynchronously, you may not be able to have two independent sessions open to your device at the same time, and one VI instance may have to wait.

Josh W.
Certified TestStand Architect
Formerly blue
Message 3 of 5
(4,223 Views)

Thanks a lot.

 

Does it imply that all my subVIs should be in this mode as well or only I should set this option for parent VI only?

0 Kudos
Message 4 of 5
(4,193 Views)
Solution
Accepted by topic author MimiKLM
Any VI that you will want to run in paralell will need to be set as re-entrant, including sub-VIs.
Josh W.
Certified TestStand Architect
Formerly blue
Message 5 of 5
(4,189 Views)