08-24-2009 03:57 PM
How do I determine the size of each dimension of a 2D array in TestStand? myArray.GetNumElements() returns to TOTAL number of elements in the (2D) array and doesn't help me. I need to iterate over only one dimension.
Thank you,
Andrew
Solved! Go to Solution.
08-24-2009 04:03 PM
Look at GetDimensions, GetDimensionsSizes, GetUpperBounds, and GetLowerBounds and decide which suit your case best.
- James
08-24-2009 04:10 PM
GetUpperBounds(int dimension) is exactly what I need. Unfortunately, it doesn't seem to be present:
Error in call to TestStand API member 'PropertyObject.GetUpperBounds'.
Method 'GetUpperBounds' does not exist in interface 'PropertyObject'.
This is the result of code: Locals.my2Darray.GetUpperBounds(0)
08-24-2009 04:11 PM
08-25-2009 09:26 AM
08-25-2009 09:46 AM
GetUpperBounds exists but just not in that context. Try something like the following...
Locals.MyDimensions = Locals.MyArray.Type.ArrayDimensions.GetUpperBounds ()
Where Locals.MyArray is your 2-d array that you want the dimensions of and Locals.MyDimensions is a 1-d array to store the dimensions. Something like...
Locals.MyArray.Type.ArrayDimensions.GetUpperBounds()[0]
... would work as well, this example would return the number of elements in the first dimension of Locals.MyArray.
Regards,
Steven Zittrower
Applications Engineer
National Instruments