NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I Pass Result Status between Test Sockets /Executions?

I have the following scenario:
 
I'm running the Batch Process model with 10 sockets. Each socket is executing a test sequence made up of many subsequences, if one or more of the sockets Fails a test in one of the subsequences I want to notify all of the other Test Sockets so that they stop executing.
 
I have overridden the Test Report Callback for the process model however, for each test socket I want to report the Failing sockets as Failures but for sockets that may have Passed the particular subsequence I want to report in the log that the Test was "Aborted".
 
Does anyone have any suggestions how to do this?
 
Thanks,
 
RG
0 Kudos
Message 1 of 5
(4,390 Views)

RG,

What version of TestStand are you using?
I am not sure if you want to abort the execution or just set the test status to "Aborted".
For both scenarios you can use the 'Batch Synchronization" step.
Set the Batch Synchronization section to use 'Serial (one thread at a time)'.
1. The first socket that reaches the synchronization section will enter it and execute the test.
2. If the test fails you can set a file global to 'FALSE' to let the other sockets that they have to "Abort" the test.
3. The next thread that reaches the section will check the fle global to decide whether or not it should execute the test.
    You can skip the test using preconditions.
    You can also set the step  status to "Aborted" instead of "Skipped". 

Every sockets would execute the test serially.

I am attaching a TestStand 3.1 sequence file with an example.
If you have any question let me know.

Antonio Lie.

Message 2 of 5
(4,370 Views)

Hello Antonio,

I am using Test Stand 3.5 so the 3.1 sequence is fine.

You are correct I would like to set the test status to "Aborted" in the report but would also like to abort the execution for all sockets.

I also need to test the sequences for each socket in parallel. Does that complicate things or can I use the Batch Synchro. step in a similar manner?

Thanks,

RG

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

RG

The Batch Batch Synchronization step only works while you are running using the Batch model.
You can use a lock step tp accomplish the same.
Take a look to the attached example.
After the first batch fails the test, I mark the same test in the other sockets as "Aborted" and terminate the execution immediately.
You could abort the execution, but you would not get the report.
Also notice that the first socket that reaches the test (CallSubSeq1) will always fail. I am not terminating its execution though.

Hope it helps.

Te attached example is a TS 3.5 sequence file.

Regards.

Antonio Lie.

Message Edited by Antonio Lie (NI) on 03-14-2006 03:47 PM

0 Kudos
Message 4 of 5
(4,333 Views)
Hi RG,

The problem with aborting one thread after another thread fails is that you never really know what state a particular thread is in at a given time. By using the synchronization step types you're ensuring that the information you are trying to pass from socket to socket is actually getting there at the appropriate time - whereas if there is simultaneous execution you run the risk of missing the notification. For example, if thread 1 fails, but doesn't get the notification to thread 2 before thread 2 finishes, then you won't achieve the "aborted" behavior you are looking for.

That being said - you could have preconditions that look at a particular station global that indicates if one of your sockets has failed. When a test socket fails, it could update the value of that station global, and your other sockets would see that failure the next time they checked the station global value. Not very efficient, but using the SequenceFilePreStep callback you might be able to accomplish this goal.

Hope this helps RG, have a good one!
Dan Weiland
0 Kudos
Message 5 of 5
(4,323 Views)