11-20-2006 11:06 AM
This is all I can think of for now, although I'm sure there are others. Feel free to post any other "hard to find" LabVIEW items that you've had to help people find in the past.
-D
P.S. - Check out past nuggets here.
11-20-2006 12:11 PM
11-20-2006 02:47 PM
@Darren wrote:
- When using the Array to Cluster function, you must right-click on the function and choose "Cluster Size" and specify the size of the output cluster you wish to generate. I've lost count of the number of times I've had to answer the question, "How come my output cluster only has 9 elements, even though my input array has [insert number not equal to 9 here] elements?"
Yes, one of the classics that has been around forever! I remember struggling with this in ~1996 😄
Of course since this is virtually a mandatory step ("...you must right-click on the function and choose "Cluster Size..."), maybe the cluster size dialog should popup automatically wenever such a node is placed or inserted. 😉
11-20-2006 03:01 PM
Of course since this is virtually a mandatory step ("...you must right-click on the function and choose "Cluster Size..."), maybe the cluster size dialog should popup automatically wenever such a node is placed or inserted.
I agree ... either that or make it a mandatory input.
- Brad
11-20-2006 03:09 PM
11-20-2006 03:16 PM
The number of elements in the array that is wired to the Array to Cluster function is dynamic, i.e. it could be anything at run-time. Since the elements in a cluster are a part of its data type, and LabVIEW is a strictly-typed language, LabVIEW cannot compile a VI that contains a cluster with an unknown number of elements. Thus, you must statically define the number of elements in the generated cluster at edit time.
And yes, we are aware of the difficulties regarding functions with these "hidden" configuration options, and we're looking into ways of addressing this issue in a future LabVIEW version.
-D
11-20-2006 03:32 PM
@Will.D wrote:
My question is, why does it not adapt to the exact number of cluster elements already? (ahem, I am asking out of curiousity, not in a provocative manner)
"Cluster-to-array" sizes automatically, while "Array-to-cluster" cannot, for fundamental reasons.
Clusters have a fixed number of elements while the size of an array might not be known until the code executes. The array size might even vary during the run. Automatic determination of the required cluster size would only be possible if the array input size is fixed and known, e.g. if it is already folded into a constant. This is a rare case and it is probably not worth adding extra code to deal with it.
"Array-to-cluster" is not a very important function and is often abused to do things that are better done in a different way. If you look at posted code here, it seems popular for some reason to use "array-to-cluster" followed by "unbundle" to get the first few aray elements. This entire construct is better done with a properly resized "index array" node. 😉
11-21-2006 01:00 AM
Ton
11-21-2006 07:01 AM
11-21-2006 09:56 AM