06-23-2015 09:53 AM
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.
Solved! Go to Solution.
06-23-2015 11:07 AM
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,
08-03-2015 09:21 AM
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!
08-06-2015 04:25 AM
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