NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Call Executable - Error accessing ExitCode

Solved!
Go to solution

Hi

 

When I use "CallExecutable" steps I do not want the "ExitCode" in my report.
In the first step depicted below, it is seen how "ExitCode" is include per default.

 

JesperSJustesen_0-1704726289897.png

 

I am trying to use the Post-Expression as depicted below.

 

JesperSJustesen_1-1704726506261.png

 

This works perfectly fine at the first "Test UUT" iteration (I am using the SequentialModel).
The sequence crashes when running the test sequence the second time. This happens because the ExitCode does not exists.

 

JesperSJustesen_2-1704726833320.png

 

I don't understand why the ExitCode is unknown when running the test sequence the second time?

Any other good suggestions on how to get rid of ExitCode in the report? I am aware that I can insert a "statement" step after the "CallExecutable" step, but it would be so much more neat to deal with the ExitCode in the "CallExecutable" step it self.

 

Best regards

Jesper

0 Kudos
Message 1 of 3
(539 Views)
Solution
Accepted by topic author JesperSJustesen

TestStand executions reuse the same TestStand step object when you execute your sequence using TestUUTs and does not recreate any missing properties. If you want to remove "ExitCode" from the report, you can do it using the following post expression in your step - ThisContext.Step.Result.ExitCode.SetFlags("", 0, 0). Ideally only remove the "Include in Report" flag rather than set it to 0. 

 

Regards, 

Anand Jain

NI

 

Message 2 of 3
(511 Views)

Hi Anand

Thanks a lot for the very useful answer!

 

For reference this is how I clear only the PropFlags_IncludeInReport and keep the remaining flags.
ThisContext.Step.Result.ExitCode.SetFlags("",0,ThisContext.Step.Result.ExitCode.GetFlags("",0) & ~PropFlags_IncludeInReport )

 

Best regards

Jesper

0 Kudos
Message 3 of 3
(487 Views)