11-01-2011 04:25 PM
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!
11-02-2011 02:47 AM
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
11-02-2011 09:36 AM
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!
11-02-2011 09:52 AM
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
11-02-2011 10:13 AM
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
11-04-2011 03:21 PM
Thanks Doug and Ray - I have things working now! 🙂