NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Execution time

How can I get execution time in a "ProcessModelPostStep" ???
 
The reason why I cant find it is properly because it is first updated after it returns from the post step.
 
I can of course it in Locals.ResultList[0].TS.ModuleTime after the step has finished.. but I need the time in the ProcessModelPostStep.. so what to do ????... maybe there is a place where I can find the start time, and then I can calculate the rest... any ideas ???
 
Kind regards Bojer
0 Kudos
Message 1 of 2
(2,982 Views)

Bojer,

You can use the step pre-expression and post-expression to calculate the "module time".
Check the Step Execution section in chapter 3 of the TestStand Reference Manual.
This section contains a list with the order of actions a step performs while executing.
The pre-expression is evaluated before calling the step's module.
And the post-expression is evaluated after the code module is executed.
The "Seconds() " function returns the number of seconds that have elapsed since an initial base time.
So you could use this function to calculate the "Start Time" in the pre-expression and use it again in the post-expression to calculate the "End Time".
In order to obtain the "Module Time" you only have to subtract the Start Time from the "End Time".
The time you obtain using this methods not really the module time because the Pre-step substeps for the step type are called after the pre-expression is evaluated and the post-step substeps are called after the module is called. The overhead added by these steps should be minor for an action step though.

Order of actions that a step performs.

11-Evaluate Pre-Expression.
12-Call Pre-Step substeps for step type.
13-Call Module
14-Call Post-Step substeps.
15-Evaluate Post-Expression

Check the attached sequence.

Hope it helps.

0 Kudos
Message 2 of 2
(2,966 Views)