NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify step record result dynamically

Hello!
I'm building a sequence for a test equipment. The device under test has different options, so I have more steps with preconditions to test them.
Actually my report display "skipped" on steps that does not fullfill the preconditions (i.e for an option not related to the DUT).
I would like to modify the Record Result of the step dynamically, to have a report with only the used options.
 
I tryed to modify in the Pre-Expresion the "Step.RecordResult" (tried also "RunState.Step.RecordResult") property, but without success.
 
Can anyone help me?
 
Thanks a lot
0 Kudos
Message 1 of 7
(4,332 Views)
Hello Baloss,

to filter results for your sequence you can call the ReportOptions CallBack, in which you add a statement step with following expression:

Parameters.ReportOptions.ResultFilterExpression = "(Result.TS.StepType == \"yourStepName\" && Result.Status == \"StepResultStatus\")"

The report will then only show specified StepName and StepResultStatus.


Hope this can help you.
Regards
MY
0 Kudos
Message 2 of 7
(4,325 Views)

Hello MY,

thank you for your suggestion.

I just tried this, but it seems a little bit complicated: I need to specify in the callback all the test names I want to add. There is also the risk that modifying the name in the sequence and not in the report callback the report is not updated as required.

What I'm looking for is a property that can be placed directly in the step.

 

Regards

Baloss

 

 

0 Kudos
Message 3 of 7
(4,315 Views)

Hello,

I solved my problem adding a statement after each step which should be removed from report.

The statement expression is:

(

RunState.PreviousStep.Result.Status == "Skipped")?(Locals.ResultList.DeleteElements( GetNumElements(Locals.ResultList)-1,1,0)):(1)

Bye

Baloss

 

0 Kudos
Message 4 of 7
(4,310 Views)
Hi,

If you go to Configure >> Station Options, in the Preferences tab, you have a Show hidden properties option.
This one makes available a property for each step named No result (stored in the Step.TS container) that implies the copy (or not) of the Step container to the ResultList at the end of the Step execution)

That could be another way to make it... At least worth giving it a try Smiley Happy

Regards.
0 Kudos
Message 5 of 7
(4,288 Views)
Setting the Step.RecordResult property in the Pre-Expression does not affect results because TestStand gets that property value before it evaluates the Pre-Expression.

Probably the simplest way to omit a result while you are executing a step is to set the Step.LastStepResult property to Nothing in a Pre- or Post-Expression.
Message 6 of 7
(4,277 Views)
You're right Erik,

This coul be done is some well chosen engine callbacks Smiley Happy

Regards.
0 Kudos
Message 7 of 7
(4,256 Views)