NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Display Time Information in Report/Results?

Solved!
Go to solution

Is it necessary to manually calculate the following?


  • Execution start time
  • Elapsed duration since Execution start
  • Step start time
  • Step completion time

If not, where are these results available within TestStand?

 

 

I would like to store the sequence absolute timestamp (from Windows), execution elapsed time, and step duration at the completion of a step.  What is the proper callback to use for this?

 

I found the Engine.SecondsSinceStart  property, but this does not correlate with the start of an execution.  This only correlates to when the TestStand Engine was launched, not when the Sequence was started.

 

 

Any advice would be appreciated.

CLA, CTA
0 Kudos
Message 1 of 5
(5,215 Views)

You can get the execution start time using RunState.Root.Locals.StartTime.Text (Note the StartTime object is a container with several start time formats).

 

Each step result has a TS container, and in that there is the [Result.]TS.StartTime and [Result.]TS.TotalTime for each step that records. The TS.StartTime is based on the time that the engine was started, so you'd need to do some calculations to tie the step start times to the execution start time assuming that's what you need to do.

 

The callback best suited to handling the time information is to enable On-The-Fly Reporting and then use the ProcessModelPostResultListEntry callback to handle the time actions you require. If you don't want to muck with the process model, you can use the SequenceFilePostResultListEntry callback for the calls in that sequence file.

 

-Jack

0 Kudos
Message 2 of 5
(5,189 Views)

 

Thanks for the response.

Capt. Jack wrote:

 

Each step result has a TS container, and in that there is the [Result.]TS.StartTime and [Result.]TS.TotalTime for each step that records. The TS.StartTime is based on the time that the engine was started, so you'd need to do some calculations to tie the step start times to the execution start time assuming that's what you need to do.

 

-Jack


 

It seems the TestStand Time functions will output a string in the localized format and require variable creation to access a timestamp in the numeric format

 

How can the Engine.StartTime and Execution.StartTime be converted to the same format?  It seem if one could obtain the Execution.StartTime in seconds, this would be the most direct calculation.  However, I don't see an easy way to do this.

CLA, CTA
0 Kudos
Message 3 of 5
(5,164 Views)
Solution
Accepted by LVB

I did a little digging and there's an Execution.SecondsAtStart Property that you could link to the StartTime. This might be what you need to calculate the times you're looking for.

 

-Jack

0 Kudos
Message 4 of 5
(5,142 Views)

Thanks for the digging, it appears I need a better shovel.  I did a summary of relative timing information from our discussion:

 

Relative Time

  • Engine Seconds Running
    • RunState.Engine.SecondsSinceStart
  • Execution start time
    •  Execution.SecondsAtStart
  • Elapsed duration since Execution start
    • RunState.Execution .SecondsExecuting
  • Step "n" start time
    • Locals.ResultList[n].TS.StartTime
  • Step "n" step duration
    • Locals.ResultList[n].TS.TotalTime
  • Step completion time
    • Locals.ResultList[n].TS.StartTime + Locals.ResultList[n].TS.TotalTime

 

Absolute Time Conversion

  • Use this offset to convert the relative time to absolute timestamps
    • RunState.Engine.SecondsSince1970UniversalCoordinatedTime
CLA, CTA
Message 5 of 5
(5,129 Views)