NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about threads

Hi,

 

In the startup portion of my main sequence, I'm calling a new sequence to run as a separate thread. The only point of this thread is to open a VI that shows the progress of the test and some variables as the program is running. If an error occurs in the main sequence, it waits for the second thread to finish before giving the error message, which it doesn't do until the end of the main sequence. I would like the LabVIEW window to stay open during the entire test and that the main sequence should run as normal. I tried unchecking Automatically Wait for the Thread to Complete at the End of the Current Sequence, but it didn't make a difference.

 

Is there a way to have a LabVIEW front panel stay open while the test continues with what It's doing, without getting this problem? Maybe have the VI exit if an error bool is set, or some sort of setting I don't know about?

 

Thanks!

0 Kudos
Message 1 of 2
(2,564 Views)

Your VI running in the new thread should use Thread.ExternallySuspended and the termination monitor (I think it's in the labview teststand palette as well as in the API - Engine.GetTerminationMonitorStatus). Please read the API help for these and let us know if you have any questions.

 

Using Thread.ExternallySuspended will make it so that breakpoints still work while your VI is running and the termination monitor makes it so that if the execution is terminated your VI cancels what it's doing and exits.

 

-Doug

0 Kudos
Message 2 of 2
(2,553 Views)