From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Detect "terminated" status of sequence call

Go to solution



I am using TestStand 2012 and one of my sequences is a bunch of sequence calls to other sequences.

Each call is being made using the "Use New Execution", and waiting for the execution to finish before the next step.


I am using this option because I like having different reports for each sequence.


However, I still would like to capture which call succeeded or failed in my main sequence.

For this, after each call, I have a statement whose status expression is:

( Find( RunState.PreviousStep.ResultStatus, "Passed", 0, True, False ) >= 0 ) ) ? "Passed" : "Failed".


The problem I'm finding is that when one of the sequences I'm calling is terminated in the middle due to an error in the UUT which doesn't allow me to continue testing, the main sequence gets the status as "Passed".


So, when I see "Passed" in my main sequence report, I still have to open the individual reports to make sure it really passed.


Would anyone know a way around this?


I tried changing the status expression of the sequence call step but it's a read only field.


Thank you in advance,


0 Kudos
Message 1 of 6



I'm confused.  So you have one call to a sequence using new execution and then you are calling a bunch of subsequences from that.  Or you are calling a sequence directly and that sequence is calling a bunch of subsequences using a new execution for each?


You can store a reference to the new execution/s and then call the GetStates method.  This will tell you if it was terminated, aborted, or what.


Hope this helps,

~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6



Sorry for the confusion... let me try to be more clear...


So, my test campaign for a specific UUT is composed of about a dozen sequences, which can be run independently. But I created another sequence, to work as a "batch", calling all these dozen sequences.

Pretty much what it does is:


1) Call first sequence in new execution

2) Wait for execution to finish

3) Check results of execution

4) Add results to report

5) Wait 10 seconds

6) Call second sequence in new execution
7) So on...


So, for each new execution, I have a dedicated report, which is exaclty what I want. But for my "batch" sequence, I would like to be able to get a report saying which executions passed or failed, so I don't have to open the reports for each execution individually.


The way I'm doing this (in step 3 above) is with the following expression:
( Find( RunState.PreviousStep.ResultStatus, "Passed", 0, True, False ) >= 0 ) ) ? "Passed" : "Failed"


This way, anything different than "Passed" would give me a "Failed" result for that execution, and that's fine. The problem is that when one of the executions is terminated before it's finished, the PreviousStep.ResultStatus is giving me "Passed".


I didn't know about the GetStates() method... Looks promissing! I'll give it a try.

0 Kudos
Message 3 of 6
Accepted by topic author leandroaveiro

Ok that makes sense.  Yeah when you call a sequence in a new execution you can store an Object Reference.  Just store it to a local variable.  Then you can look at the state of that Object Reference.  Although you may have to play around with it because if the Execution is gone I don't know what state you will get.


Let me know if you have any questions about that.

~Will work for kudos and/or BBQ~
Message 4 of 6

Hey Leandro,


The issue you're encountering is actually a known issue; it's in our system under the identification number 224640 and currently appears in the Known Issues list for TestStand. I made a notation in our file on this issue to let our developers know that you encountered it.


Jiggawax's suggestion is a good one; you might explore using the Execution object to get the information you need. Another approach would be to set your sequence up so that a runtime error actually causes a step failure instead of termination. This would allow the status to propagate to the Sequence Call step.

Daniel E.
TestStand Staff Product Support Engineer
National Instruments
0 Kudos
Message 5 of 6

Thanks for the info guys... using the GetState method worked.

Even after execution ends, the termination state gives me if it 1 if ended normally or 2 if terminated forcefully.

0 Kudos
Message 6 of 6