NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence pass fail or terminated

Solved!
Go to solution

Hi there.

 

In my teststand sequence cleanup (see attached) I have an "if" "else" statement that will log a "TEST_PASS" or "TEST_FAIL" whether the test has passed or failed.

What I am finding is that if the test is terminated it logs as "TEST_PASS", but I would actually like it to log as "Terminated".

What would be the best method for doing this?

 

TIA

Jim.

LABOR OMNIA VINCIT
0 Kudos
Message 1 of 4
(6,022 Views)

You can use Execution.GetStates to get the termination state and the RunState.

 

Save this to a local variable and then use that in your IF statement as well.

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(6,010 Views)

Hey there, sorry for delay in response.... so if I used "RunState.Exection", what expression do I require to capture terminated, guessing in my cleanup I require somthing along the lines;

 

If  RunState.Exection ??????

f(x) Statement FileGlobals.TestResult="TEST_TERMINATED"

 

Else if RunState.SequenceFailed==False

f(x) Statement FileGlobals.TestResult="TEST_PASS"

 

Else

f(x) Statement FileGlobals.TestResult="TEST_FAIL"

 

End

 

 

TIA!

LABOR OMNIA VINCIT
0 Kudos
Message 3 of 4
(5,860 Views)
Solution
Accepted by topic author jimbobaggies

Just in case anyone searches and is looking for similar, here is the solution I have reached with help of NI Support;

 

Create two local variables called runState and termState, my cleanup section is now as follows;

 

 

f(x) Statement RunState.Execution.GetStates ( Locals.runState, Locals.termState)

 

If  Locals.termState!=1

f(x) Statement FileGlobals.TestResult="TEST_TERMINATED"

 

Else if RunState.SequenceFailed==False

f(x) Statement FileGlobals.TestResult="TEST_PASS"

 

Else

f(x) Statement FileGlobals.TestResult="TEST_FAIL"

 

End

LABOR OMNIA VINCIT
0 Kudos
Message 4 of 4
(5,821 Views)