10-07-2008 09:23 AM
Is there a function to return a maximum and minimum array value for a TestStand array?
I could create a LV code module and pass the array in, evaluate using a LV function and return the results, but I'm looking for a TestStand native or possibly an ActiveX function...
Solved! Go to Solution.
10-07-2008 04:40 PM
Hi Phillip,
In my opinion there no build in function providing this.
But you can do this by using two build in steps.
Iterate through the Array with the ForEach Step Type and then determine in a simple Statment step the MIN and MAX Value of your array
Hope this helps
Juergen
10-07-2008 04:57 PM
10-08-2008 07:57 AM
This works fine. I didn't mention in my original post that I was looking to do this in TestStand 3.0.
I've just started looking at all the new features in 4.1 as part of the upgrade that I am responsible for. I might even try to create a template for this so that it can be easily dropped where need.
Thanks for the help!
08-08-2022 11:47 PM - edited 08-08-2022 11:48 PM
You can also use an expression-step with following content:
Sort(Locals.MyArray,True),
Locals.MyMin=Locals.MyArray[0],
Locals.MyMax=Locals.MyArray[GetNumElements(Locals.MyArray)-1]
Please be aware, that the second parameter in Sort-function reorders the origin array. If you don't want this behaviour, you will need a temporary array like this:
Locals.MyArrayTemp=Sort(Locals.MyArray,True),
Locals.MyMin=Locals.MyArrayTemp[0],
Locals.MyMax=Locals.MyArrayTemp[GetNumElements(Locals.MyArrayTemp)-1]