NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Step Test Time

Solved!
Go to solution

O am using TestStand 2016. I have several steps I need to execute that load firmware into the UUT by calling third party applications. Then only way I know if it succeeded is by the time it takes. If it succeeds it takes longer. I need to determine how long it took to execute the step. I have found several articles and posts that said to use the following:

 

Locals.ResultList[0].TS.TotalTime

 

I added a Statement step, and used the above to try to get the time for the step in question, but my sequence won't even execute. I get the error:  Unknown variable of property name 'Locals.ResultList[0].TS'. I noticed all the posts were from years ago, so maybe something has changed in more recent versions of TestStand.

 

How do I get the step execution time?

0 Kudos
Message 1 of 5
(3,917 Views)
Solution
Accepted by topic author Jo-Jo

You can only use that expression after the step has executed.  When a step executes a lot is going on.  You can see all of the actions here: https://zone.ni.com/reference/en-XX/help/370052R-01/tsfundamentals/infotopics/step_execution/

 

Notice that not until actions 35 and 36 (which are the last actions) does the step actual put anything of value into ResultList.  It will create the spot in ResultList in action 1.

 

What does that mean?  you cannot access that data until after the step has executed.

 

So what is a better solution?  Check out the following code.  I use a pre and post expression to grab the time and then calculate the difference it took to run my code module (action 16 of the step execution).  

 

Let me know if you have any questions.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 5
(3,863 Views)

Just a thought - you could do away with the need for a local variable by writing the start time to the result.numeric and then use that in the calculation for the elapsed time:

 

Pre-Expression

Step.Result.Numeric = Seconds(True)

 

Post-Expression

Step.Result.Numeric = (Seconds(True) - Step.Result.Numeric)

 

Regards,

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

Message 3 of 5
(3,855 Views)

Thanks for the help.

0 Kudos
Message 4 of 5
(3,850 Views)

@CharlieRodway wrote:

Just a thought - you could do away with the need for a local variable by writing the start time to the result.numeric and then use that in the calculation for the elapsed time:

 

Pre-Expression

Step.Result.Numeric = Seconds(True)

 

Post-Expression

Step.Result.Numeric = (Seconds(True) - Step.Result.Numeric)

 

Regards,


Clever.  I'll keep this in my bag of tricks.  Usually I use an attribute but this is even easier.

 

Thanks,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 5
(3,841 Views)