NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ResultList Missing Elements

Solved!
Go to solution

I am trying to display the execution time for each individual step in my report. I am following this guide How to Include Execution Time of Each Step in TestStand Report? - NI. On step 6 it says to set the value to log to "Locals.ResultList[RunState.StepIndex].TS.TotalTime". When I do this and run my sequence, I get an out of index error. I later realized that my Locals.ResultList variable is completely empty. There is not even one element in it. Am I missing something? I've gone into Configure -> Model Options and I have confirmed that Discard Results is unchecked. I didn't see any option in Result Processing for this either. From what I have seen, I seem to be alone with this specific issue. I picked up this project from someone who retired so it is possible that they changed a setting that got rid of the elements. For reference, I am using TestStand 2020 (32-bit).

Also, here is a picture of my Local Variables:

IMG_20250310_145940935.jpg

Let me know what you guys think. I'll update this thread if I find the solution.

 

-Jeremy

If it don't NI Test, it won't NI Stand™
0 Kudos
Message 1 of 11
(347 Views)

Hi,

Couple of options to check:

1. In Configure -> Station Options -> Execution tab - Ensure "Disable Result Recording for All Sequences" is disabled. 

2. In Edit -> Sequence properties -> Ensure "Disable Result Recording for All Steps" is disabled. 

 

Also, are you able to reproduce the issue of no results being collected, with a new sequence file and one statement step?

 

Regards, 

Anand Jain

NI

0 Kudos
Message 2 of 11
(308 Views)

I just checked both options and both are unchecked. If I create a new sequence file, I still get the same thing. ResultList remains empty. 😞

If it don't NI Test, it won't NI Stand™
0 Kudos
Message 3 of 11
(289 Views)

Do you happen to have on-the-fly enabled in your report settings?

0 Kudos
Message 4 of 11
(286 Views)

I do not. I tried enabling it and running the sequence and it did a weird loop at the end of my UUT a few times before it finished. I should also add that I do have the total execution time displaying in my report. I just can't get the individual execution times for each step.

If it don't NI Test, it won't NI Stand™
0 Kudos
Message 5 of 11
(275 Views)

Wait.... are you saying that you see results in your report although ResultList is empty?

Not referring to what you want to add, but the standard results for your test.

0 Kudos
Message 6 of 11
(268 Views)

Yes, I have my results all displaying properly. I just can't use the TestStand API to read "Locals.ResultList[RunState.StepIndex].TS.TotalTime". I get an out of index error when I do this and since the array Locals.ResultList is empty in all my sequence files, I assumed that was the cause for the error.

If it don't NI Test, it won't NI Stand™
0 Kudos
Message 7 of 11
(265 Views)

Questions:

 

1.) When did you take the pic in your very first post? Execution supended? No execution?

2.) When do you try to read Locals.ResultList[...]? Guess during runtime? From regular code or a runtime? Are you running the code with a  process model like SinglePass or TestUUTs?

0 Kudos
Message 8 of 11
(262 Views)

1.) The picture was taken with no execution.

2.) I believe I am reading it during runtime. I have it set at an additional value to log on only certain actions. I am also running the code as a TestUUT. Its being called from a main sequence file. This is just a subsequence (I don't know if that matters or not).

If it don't NI Test, it won't NI Stand™
0 Kudos
Message 9 of 11
(255 Views)

1.) The ResultList is always empty during design time, so this is no error. it gets populated while the sequences runs, so elements can only be inspected e.g. if the execution is suspended

2.)  Runstate.StepIndex is a dynamic data object which also only exists during run-time. This is why this

Oli_Wachno_0-1741757180811.png

shows up in red.

 

If there is a Runtime Error (please provide a ascreenshot), I believe it's more due some kind of typo

 

Further diagnostics:

 

Put a breakpoint on the first step of your sewuwnce and the step after.

On hitting the first breakpoint, please check Locals.ResultList --> should still be empty, RunState.StepIndex should be 0

Run the step and on the following breakpoint, you should see an element for the previos step in Locals.ResultList, RunStat.StepIndex should be 1 now

 

Can you confirm?

 

 

0 Kudos
Message 10 of 11
(235 Views)