NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding step execution time to SequenceView control

I want to add each steps execution time in the SequenceView control of my operator interface. What is the expression statement I should use for the column properties of the SequenceView control?

I appreciate any assistance and look forward to your response(s).

Thank you,
Jim
0 Kudos
Message 1 of 4
(4,978 Views)
The execution time for a step is stored in the last step result it generated. Although the Step.LastStepResult ActiveX property is a link to this result, currently you cannot access ActiveX subproperties directly in an expression.

So, you need to store a link to the step result in the step using a sub-property-object so that you can access it in an expression. One way to do this is to add a PostResultListEntry callback to your sequence file or process model file. In your callback, add a single activeX action step and configure it as follows:

Object Reference: Parameters.Step
Automation Server: NI TestStand API 3.1
Object Class: PropertyObject
Action: Call Method
Method: SetProperyObject
lookupString: "LastResult"
options: 0x201 // insert-if-missing and not-owning
newValue: Parameters.Result

This inserts an Alias object in the run-time copy of the step that points to the last result the step generated.


Now, bring up the property pages for the SequenceView control in your OI that displays executions. Add a new column on the Columns page. Set the column Type to Expression. For the expression, enter:

PropertyExists("Step.LastResult.TS.TotalTime") ? Step.LastResult.TS.TotalTime : ""

or

PropertyExists("Step.LastResult.TS.ModuleTime") ? Step.LastResult.TS.ModuleTime : ""
Message 2 of 4
(4,970 Views)
James,

Wow! This was a little more work then I envisioned, however, your answer explained very clearly what I needed to do and it works just like I needed it to. Thank you very much for your prompt and detailed response!

Best Regards,
Jim
0 Kudos
Message 3 of 4
(4,964 Views)
An additional note:  The solution James provides is great but will not work for Test UUTs.  The LastResult property is an alias for the Parameters.Result property object.  On the second UUT iteration, the call will attempt to insert the Parameters.Result object into LastResult.  However, upon the second iteration, LastResult is now a reference to the original Parameters.Result property.  Any calls on LastResult are treated exactly as a call on the last Parameters.Result object.  In this case, the second pass will cause error -17300.

To make the LastResult object refer to the new Parameters.Result object, the Refer To Alias flag must be set.  This forces operations to be performed on the alias (the referring object) instead of the referenced object.  Set the Property Options to 0x601 instead of 0x201.  The Refer to Alias flag is set using 0x400.

Tyler Tigue
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,859 Views)