NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Create and log arrays of data

Hello,

 

I have a sequence which has a LabVIEW action step inside of a for loop.  This step outputs a single voltage measurement.  This for loop has many other steps in it as well.  Right now, if I tell my measurement step to log its data, I will see the one result for each pass in the for loop separately.  I would like to log all of the data from this measurement step in an array (where each element of the array corresponds to a pass through the for loop) so that the operator can see the results as a plot (or at least an array) instead of as single values scattered throughout the report.  Does anybody know how I would go about doing this?

 

Thanks!

 

0 Kudos
Message 1 of 6
(3,268 Views)

Hi,

 

In the Post Expression of your Step use an expression similar to

 

Locals.readings.SetValNumberByOffset(Locals.index,1, Step.Result.Numeric).

 

This will record your measurement and store it in an array using your loop counter. Using this expression means you dont have to initialise the array to a fix dimension as the value of 1 for the Options means 'Insert if element is missing'. (Check out the Programmer Reference Help for SetValNumberBy Offset). 

 

alternately you can use

Locals.reading[Locals.index] = Step.Result.Numeric. (but for this expression you will have to set the dimension of the array, ie it can not be empty)

 

hope this helps

 

Regards
Ray Farmer
Message 2 of 6
(3,260 Views)

Ray,

 

Thanks, that helps get the data into an array - do you know how to then write the array to the log/results file?

 

Thanks!

0 Kudos
Message 3 of 6
(3,248 Views)

If you are using a recent version of TestStand you can use the Additional Results step type, or Additional Results setting on any step.

 

Hope this helps,

-Doug

0 Kudos
Message 4 of 6
(3,246 Views)

Hi,

 

As dug suggests and if you want to display as a graph, then use the Include Arrays - Insert Graph in the ReportOptions, but you have to be using HTML or XML

 

 

Regards
Ray Farmer
0 Kudos
Message 5 of 6
(3,242 Views)

Thanks Doug and Ray - I have things working now! 🙂

0 Kudos
Message 6 of 6
(3,222 Views)