NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Error Msg from A step in TestStand into a variable (with Record Result disable)

I have disable "Record Result" in a step (action) that call a Labview VI (Minimise memory usage during long run).
But I want to capture the error msg and put it in a local variable (locals.log).
So in the "Post Expression" of that step, I add:
locals.log = step.result.error.msg

But it always an empty string, Is the post expression executed when the there is an error in the step ?
So How can I capture it ?
0 Kudos
Message 1 of 3
(3,425 Views)
Hi,

The trouble is that when a step errors, the Post Expression doesn't get executed.
Try using one of the Override callbacks - SequenceFilePostStepRuntimeError, ProcessModelPostStepRuntimeError or StationPostStepRuntimeError.
There is an example in the Examples\Callbacks.
The Step properties are passed as a parameter to the callback so you can get the error message and do your logging.

Hope this helps
Ray Farmer
Regards
Ray Farmer
Message 2 of 3
(3,425 Views)
Thank you :),

Actually, I found a way to do what I want,
I actually set the step so that if it passed , it goes to a Label "SetPASS", and executed next step if it failed or on error.
In the next step, I could use property:
"RunState.PreviousStep.Result.Error.Msg" to access the
errorMsg or error code.

But again the call back might be usefull too.

Example:

Step VI, (if PASS goto Set PASS, else go to next step)
SetFAIL, (Access the error msg from prev step)
DONE
SetPASS ....
0 Kudos
Message 3 of 3
(3,425 Views)