NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple instances of VI in separate threads

Solved!
Go to solution

Hi,

 

I am trying to execute two instances of the same VI (with separate sequence contexts) in two separate threads. These two instances are called from two separate sequences, using a new thread for each sequence. The problem is that the instance of the VI called from the second sequence does not execute until the first one has stopped. I need some help in making them execute in parallel, they shouldn't be waiting for each other to finish.

 

Thank you,

Chris

0 Kudos
Message 1 of 5
(3,811 Views)
Solution
Accepted by chris86

Chris,

 

the VI itself is executed by the LV runtime engine. Hence, if the VI is non-reentrant, it will block all calls, regardless of the calling threads, if it is already executing.

 

Depending on the content of that VI, the most obvious solution is to set the VI "reentrant".

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 5
(3,809 Views)

Awesome! Problem solved, thank you!

0 Kudos
Message 3 of 5
(3,806 Views)

Hi, although the reentrant setting fixed the issue, the VI's are no longer exiting. My sequence executes successfully up to the end, and then just sits there waiting for the VI's to exit.

I was able to stop them successfully before making them reentrant. Do reentrant VI's require alternative methods for stopping them?

 

Thanks, Chris

0 Kudos
Message 4 of 5
(3,800 Views)

Chris,

 

depending on the way how you stop them, it might be necessary to change that.

As you have a bunch of individual clones running, you have to stop each clone individually.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 5
(3,786 Views)