NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What happen when an error occur when there are 2 threads running ?

Here is my execution :

My MainSequence calls another sequence in a new thread. This sequence call a VI continuously

 

When an error occur in the MainSequence, nothing happen : The step with the error in Mainsequence is still in execution state (with the arrow in front of it)  and the VI in my 2nd thread is still running. All I can't do is terminate all thread

 

Is this behaviour normal ? What is the mean to solve this problem (maybe calling the 2nd sequence in a new execution ?)

 

Thanks for your answer

 

Laurent

0 Kudos
Message 1 of 2
(4,249 Views)

Each thread has its own error state. To get the results for a thread (including error result), you need to have a wait step which waits for it. If a thread has an error and you wait for it, you will get the error at the wait step that waits for it.

 

If your main thread has an error and you want some worker thread to exit, you should add code to the cleanup of your main thread's sequence which signals the worker thread to exit (you should already have some sort of mechanism for signaling the worker thread to exit (there are many ways to do this, for example, a boolean variable passed by reference to the new thread's sequence, or a TestStand notification).

 

If your main thread is getting an error, but is stuck inside a step, that problem is probably specific to something your code is doing, that is not the normal behavior of TestStand. You will need to provide more details or an example sequence in order for us to better understand what is happening.

 

Hope this helps,

-Doug

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