NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

async task passing results back

Hello teststand experts out there,


I have a question regarding getting results back from an asynch sequence.


I have set up a test sequence, call Test2.seq. This sequence calls another sequence TestAsync, which runs in a new thread.
In TestAsync, a vi code module 'StopValveGet.vi' is called. This vi sends back results (FileGlobals.StopValve.DateTimeArray,
FileGlobals.StopValve.DateTimeArraySize) to TestAsync. This vi also monitors the FileGlobals.StopValve.End to check for the exit condition.
Test2.seq stops the StopValveGet.vi by setting the FileGlobals.StopValve.End to True.

 

I am using TestStand 2014 and LV Run time engine 2014.


I have noticed something, i.e. for the results(FileGlobals.StopValve.DateTimeArray) to appear in
the 'Additional Results' step, I need to use a Wait2 Step and the time to wait needs to be > 1 second (See picture)

This lead me to following questions:


1. Do the FileGlobals.StopValve.DateTimeArray and DateTimeArraySize need time to propagate from TestAsynce to Test2 sequence? It seems so after I experimented with different Wait2 Step's time setting and also the Loop wait time in the StopValveGet.vi (currently set to 1 second).


2. Could it be that the TestAsync is not running in parallel eventhough it is set to running on its own thread? This is because the wait1 step is set to 5 seconds and
there should be enough for StopValveGet.vi to filled the FileGlobals.StopValve.DateTimeArray and DateTimeArraySize variables during that 5 seconds. So technically I do not need the Wait2 Step as the results are already set during the Wait1 Step. I tried setting a break point in the StopValveGet.vi (I also switched the LV adapter to LV development) and see if it was triggered during the Wait1 step and it did, so this means it is running in parallel right? So I don't understand why I need the Wait2 Step and it has to wait > 1 second.


3. Maybe what I am doing (using FileGlobals to transfer variable values) is not very clean. Is there any other better options? Queue, or passing Parameters by reference to TestAsync (I tried this and it did not work)?

Please help me if you have any ideas. I am attaching my sequence and code module for you to see.
 

Download All
0 Kudos
Message 1 of 1
(3,297 Views)