08-17-2016 10:55 AM
Hello Community,
Using Teststand 2014 32bit
I have an array that is one-dimensional with a size of ten (Array[10]). I want to be able to take an average of this array in Teststand. Using a statement expression I am able to do Numeric = ((Array[0] + Array[1] + ... Array [10]) /10), but that is tedious. Especially, if I have an array of more than ten.
In Teststand is there a math operation or another way to get the array average?
Solved! Go to Solution.
08-17-2016 03:07 PM
I don't think it's possible in a single expression. Consider the attached example that does it in a single step.
Hope this helps,
08-18-2016 02:35 AM
08-18-2016 03:21 AM
Hope it will be good if we have an option like Add Array function is TestStans Expression.
As others suggested use For Loop with Array size as your N for Loop.
08-18-2016 03:22 AM
Hi MechUnit,
I'd definately use a looping statement step; I wrote an example last night but didn't have time to post it.
It looks like Jigg and Juergen have pipped me to the post
See my attached example.
Regards,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
09-02-2020 11:22 AM
At the "Average Example.seq". I had to remove the Pre-Expression (Locals.DataAverage = 0)
Now it is working. Thank you