@Darren wrote:
For arrays, it may be important to keep in mind that an Array Variant is not the same thing as an Array of Variants. The Variant to Data function will happily give the old college try to convert datatypes that are compatible. This means it will dutifully go through your original array, element by element, and create a variant for each one, and build that into an array. If that sounds like it may be slow, it is. That function is about 50-100X slower when converting to an array of variants than it is converting to the exact underlying array datatype. With large arrays, that is a steep price to pay to just get the length.
If there were only small arrays, and a lot of different datatypes involved, I might use this 'shortcut'. Otherwise I would use GetArrayInfo.vi to figure out the array element type, and then use a case structure to do a direct conversion to the correct type and grab the length. Pretty straightforward, and I doubt your eyes will bleed looking at it.
If your clusters are so large that it starts to slow down this function, then you have other issues and need to get help immediately. There is already a GetClusterInfo VI in vi.lib and on the pallete, so that is how I would roll.