I need to pass around three related numbers (it's an address) in various parts of my VI's. I was trying to do this with a 1-dimensional array of three elements; however, the array control and indicator allow me to view indefinitely many elements, and I don't see a property node to limit the number of elements.
Oh, so put a brown cluster inside of my pink cluster? I guess that would work, but that means that I'll need three separate controls to adjust the address, right?
You didn't mention having a cluster to begin with, so I don't know if you want to put a cluster inside another cluster. To answer your direct question: without knowing more about your overall use, one could say that there's not much difference between having three separate controls in a cluster for the address as opposed to three different elements of an array.
Okay, here's the VI, using a brown cluster. It turns out that you *can* have one control bank for an entire cluster. Does this work as well as an array could? (The inc_dec VI just passes the cluster off to a sub-VI that splits and reads it.)
Okay, but is there any way to prevent an array control from adding elements?
Also, are there any problems that occur with stacked cluster use, as I've done in the VI above? That brown cluster control is functioning well as near as I can tell, but I've never used that, so I don't know whether it can cause problems elsewhere.
I can't open the VI since I only have LabVIEW 8.2. If you use an array control you cannot prevent someone from adding additional elements. However, if all you're looking at is the first three elements, it doesn't really matter. You can always hide the index display by right-clicking on the control and unchecking the Visible Items->Index Display item. Just resize the control to display three elements.
There's really no overriding technical reason, so it's really up to you as far which method you prefer, and which makes more sense for your application. With an array as a control the elements are grayed out until someone actually enters something in the element. With a cluster, that's not the case. However, you can simply set the array to have a default value, and it will look the same as a cluster.