NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Teststand: Step.Result.Error.occured does not work

Hello Everybody,
I'm, testing a failsafe routine in my sequence. 

Gheim_0-1654237503096.png

 

as you can see in this picture, there's an error in the module, which I produced on purpose, there's also a test variable pointing on that error.

Gheim_1-1654237588703.png

, however that test variable which is pointing directly on the step.result.error.occured is false. As seen in the variables window.

Gheim_2-1654237645161.png

 

I can clearly see the Error in the trace window, and howevering above it, I can also see the ErrorCode, as well as in the ResultList, but the variable Error.occured always stays false.
I don't understand that behavior at all, how comes he clearly displays status "Error" with the errorCode, but the Error Occured remains false ??

0 Kudos
Message 1 of 2
(923 Views)

How do you know that the error.occured is still false?  You are setting the local variable in the pre-expression which means nothing.  Of course it's false at that point.  I'm assuming your error is happening after your code module executes.  If you look at the step actions here:

https://www.ni.com/docs/en-US/bundle/teststand/page/step-execution.html

 

You'll notice that the pre-expression happens before the code module gets called.  Try setting the local variable in the post-expression.  It's very clearly being put in the result because you can see an error in your status column.  

 

Another option is to break after the step executes and then look in the runstate property and see what error.occured is set to.

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