NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass error status to UUT result

I have station option set to ignore run time errors. Because of this all my sequence shows the results as passed regardless of any run time error. Now what i want is to display error on both the step status and the UUT status. I manged to display "Failed" using SequenceFilePostStepRuntimeError and setting RunState.Caller.RunState.SequenceFailed to true.But i really want to display "Error" rather than "Failed". I want the execution to ignore errors and continue, but the UUT status should be ERROR even if one of the step has a status error.
0 Kudos
Message 1 of 5
(4,623 Views)

"I want the execution to ignore errors and continue, but the UUT status should be ERROR even if one of the step has a status error. " 

 

 

Why do you want to continue and ignore errors?  Plus since you want to display ERROR as the final UUT Result, why bothering continuing with the test if an error occurs.... Won't the test simply not work properly if any errors occur in previous steps?  Why not set the Station Options to "Run Cleanup" on Run-time error?

 

Thanks,

 

Paul

 

 

0 Kudos
Message 2 of 5
(4,611 Views)

HI Paul,

 

Thanks for your reply. The product we are testing is in a very early stage of development. If we are going to run cleanup after an error, most of the sequences will not run till the end, as we are expecting lots of errors at this stage. Once the product is mature, definitely we will run cleanup after an error. I know Teststand treats all the errors as critical run time errors. In our cases, the errors appear because the product is not responding now, the way we want. Currently the report says FAILED when an error occurs. We could not differentiate from an actual failure from error unless we go deep digging into the report. I was looking for a way we set UUT status to ERROR in SequenceFilePostStepRuntimeError callback.

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

What do you mean "most of the sequences will not run till the end?" Do you mean to say that you expect that you will encounter errors in the early steps of a sequence, and as a result, will not be able to execute the rest of the sequence?

 

One way to overcome this scenario is to contemplate some error handling. Where exactly do these errors originate from? Are they in some code modules? If so, what is the environment for these code modules? Perhaps you could consider processing the output from these code modules to detect the errors and appropriately display the errors before the step fails. 

Raj
National Instruments
Applications Engineer
Message 4 of 5
(4,565 Views)

Raj,

 

Thanks for your reply. You are right, Error handling is another way to fix this issue.  In my case, it is not a permanent fix. As the product reaches a more mature stage, these errors cannot be ignored, it must be reported and i may have to handle the errors differently during different stage of the development. I managed to modify the process model to fix this issue. After my main Sequence callback, i go thro the results, if i find any error, i change the the locals and runstate variables as decribed below

 

RunState.Sequence.Main["MainSequence Callback"].Result.Status="Error",

RunState.Sequence.Main["MainSequence Callback"].Result.Error=Locals.ResultList[0].TS.SequenceCall.ResultList[RunState.PreviousStep.Offset].Error,
Locals.ResultList[0].Status= "Error", Locals.ResultList[0].Error=Locals.ResultList[0].TS.SequenceCall.ResultList[RunState.PreviousStep.Offset].Error,
Locals.ResultList[0].TS.SequenceCall.Status="Error"

 

This gets me a step status "Error" in the report even  if i ignore the error in my station options. I am sure there might be a better way to do this. Currently this works for me..

Message 5 of 5
(4,562 Views)