LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating an array of clusters of indicators?

I created an indicator cluster and made a typdef custom control out of it.  I then instantiated eight of them on my app's front panel.  These indicators show the status of various things in my system.  Since there are eight identical indicator clusters, it would be convenient to create an array of these clusters so I can let a for loop handle the processing that sets the indicators.  But my problem is that I see no way to create an array of these indicator clusters.

It appears that I can create an array of references to each of these clusters, and then in the for loop use the Controls[] property in each cluster to get to the indicator, but it's not at all clear which index in the Controls[] array refers to which indicator. Bundle-by-name is a heckuva lot more convenient...so what have I missed?

thanks,
-a
0 Kudos
Message 1 of 7
(3,666 Views)

Create your cluster.  Then create an empty array on front panel.  Resize array to be big enough to drag the cluster into it.  Drag the cluster into the array box.  Voila!

Message Edited by tbob on 04-04-2006 06:03 PM

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 7
(3,663 Views)
Oh, cool, that worked!

So, now how do I show all eight members of the array at the same time?

-a
0 Kudos
Message 3 of 7
(3,659 Views)
Drag the array border to the lenght you want.  Be careful, don't grab the inner cluster border, grab the outer array border.  As you click and drag, you will see the next cluster displayed when the boundry gets large enough.  Continue dragging until all 8 clusters are shown.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 7
(3,645 Views)
Ah, I see; the cursor changes to a little Stealth Fighter and when you drag it, the other array members appear.

But this only works when dragging horizontally.  I'd like a two-row by four-column matrix display and the mechanism won't let me drag vertically.

Another interesting observation: If I enable the label or caption display for any member, that display is enabled for all, and they're all identical.  If I change one, the others change to that same value.

(I know ... complain, complain, complain).

This is LabView 7.1, if it makes any difference.

thanks again,
-a
0 Kudos
Message 5 of 7
(3,639 Views)
If you want a 2 x 4 matrix, this is a 2D array.  You have to right click on the array border and select Add Dimension.  You will see two index controls at the top left instead of just one.  Now you can drag the array border in the vertical direction and display several rows.
An array must have identical types for all of its elements.  That is why labels and captions are the same for all elements.  You can't change them individually.  That is just the nature of arrays.  If you need to have individualized elements, use a cluster instead of an array.  The labels and captions of array elements should not present a problem.  The elements are distinguished by the array index number, like Array(1) or Array(2), etc.
- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 7
(3,635 Views)
OK, got it.

Instead of a 2x4 array, I put a cluster on the front panel and put eight instances of my indicator cluster into that cluster. In my block diagram I have a for loop iterating for each of these instances.  I used the Array-to-Cluster guy to convert the array created by the for loop to my new cluster-of-clusters.  I puzzled over why LabView kept telling me that I was connecting a cluster of nine things to a cluster of eight things, until I clicked on the "more help" link in the error message.  The Array To Cluster help said "right-click the node and select Cluster Size from the shortcut menu to set the number of elements in the cluster.  The default is nine."  Dunno why they chose nine, but that explained why my cluster from my for loop had nine elements instead of eight.  I changed the cluster size to eight and all is well.

thanks for the help!

-a
0 Kudos
Message 7 of 7
(3,625 Views)