08-28-2009 03:43 PM
Here is something that keeps coming up and now I have time to see if I can find a solution. I often have an Array of Clusters of some sort in my LabVIEW programs. They are super convenient, but one annoyance I have is that the labels have to be in each element of the array or have no labels at all. Is there a way to have the labels only appear in the first element and then hidden for all other elements in the Array? This would save a lot on front panel real estate.
The best I have been able to come up with is turning off the labels all together and adding labels above the Array control.
08-28-2009 04:20 PM
08-28-2009 04:33 PM - edited 08-28-2009 04:36 PM
rats... I was hoping for some creative hack to work around that fact. In other programming languages I've used, there were ways to specify (if you wanted to) first element, odd element, and even element properties. This worked really well for having a "header" row, and also alternating background colors.
Maybe I should suggest something like that added to LabVIEW.
08-29-2009 12:42 AM
08-29-2009 02:06 AM
I wonder what other programming languages that are. Sounds to me like a super ineffektive way of property implementation to allow individual array elements to have different properties. Sure enough when you consider that LabVIEW arrays can potentially have 2^31 elements.
Rolf Kalbermatter
08-29-2009 02:23 AM
08-29-2009 12:16 PM
NitinD wrote:
Why don't you just use a free label for marking the contents of the cluster, a bit of a hard work, but when i have too many clusters, i make all labels, take a screenshot, and paste the jpeg instead of the labels...... I'm not sure whether I'm getting your problem right... don't free labels offer better help? you could group it along with the cluster too!
I don't think you can change free labels. But you could add the labels as being other elements of your cluster, using classic string controls and color them transparent. Arrange the new strings so that they look like labels for your other cluster elements.
08-29-2009 11:36 PM - edited 08-29-2009 11:37 PM
Ravens Fan wrote:
I don't think you can change free labels. But you could add the labels as being other elements of your cluster, using classic string controls and color them transparent. Arrange the new strings so that they look like labels for your other cluster elements.
How does it help solve the problem? I'm not sure if I've got the problem right. So please correct me if I'm wrong. So, the problem here is that labels come in all the elements of the array of clusters, like here:
What I'm I think you're suggesting Raven, is to add some more labels into the cluster, like in the next pic, I have unchecked the label of numeric control "test 01" and added a free label instead.
What I understood from the OP is that the cluster labels should be visible only in the first element and not in the rest. I think that would look kind of unbalanced. However a work around would be add free labels outside the cluster, by customizing the array. Or just adding free labels on the front panel and grouping it along with the array like this:
So, am I barking up the wrong tree?
08-30-2009 10:13 AM
08-30-2009 01:10 PM
Creative? Maybe. A hack? No doubt about it. Here is a variation on a trick I have used a few times to work around the property limitations of an array. It costs you at least one additional copy of your array, not a problem for the GUI applications where I have used this. The example I posted is for a (2D) control, indicators are even simpler since you don't need the Value Change event cases. Free labels are often effective, but sometimes I don't get the look I want.