NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate a Report from tests in a thread

I put my TestStand test code in a seperate thread and now the reports are missing the tests.

I wanted to have a cancel button so I created 2 threads + the main line process.

The threads are created as an executable using "Use New Execution" and terminated using the automation server.

 

  1. Thread 1. A Cancel button on a message popup.
    If the user click the cancel button then a global flag is set, CancelTests =  True

  2. Thread 2. The actual test code.
    This controls the instruments and takes measurements and does tests.
    The flag: "TestRunning" is set true at the start and set false when complete.

  3. Main Line.
    A while loop that does a 5 second sleep then checks the status of the TestRunning and CancelTests flags.

This all works fine except now the threads fail to log any tests that are in the thread 2.

 

How can I get the test code in Thread 2 to record results?

 

 

Message 1 of 2
(2,600 Views)

Hi,

 

Take a look at this KnowledgeBase article, NI Community Example and Developer Zone article.

Hope that helps.

Rohama K.
Message 2 of 2
(2,572 Views)