LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set label text for numeric indicators in an array?

I have an array of doubles. Each item in the array has a label on the VI panel. How can I set the label text (differently) for each item in the array at run-time.

In the above example all items are labeled "Sensor item 1". I want to label each item differently.

0 Kudos
Message 1 of 5
(3,953 Views)
You can't. In an array only the values of the elements can be different.
0 Kudos
Message 2 of 5
(3,950 Views)
I can set the albel of a numeric indicator at run time.
Isn't the array control simply an array of numeric indicators?
If so, then I sould be able to get a reference for each indicator in the array and set the label's text property.
 
If not, then isn't there a windows call using a handle or something that I can do?
0 Kudos
Message 3 of 5
(3,937 Views)
All ellements of an array have identical properties, only the value can differ. (The label is a property).
 
 
You have quite a few options, you just need to be a bit creative:
 
You can make a cluster of a string indicator and a numeric, and make an array of those. Now you can write yuor label to the string and the number as numeric.
 
Are these controls or indicators? If you only need these as indicators, you could format you array into a table and write the row headers according to the desired labels. THis would even look better. 😉
0 Kudos
Message 4 of 5
(3,926 Views)
I inherited the code and the VI returns an array of strings (the labels) and an array of doubles (the values).
The data is returned about every 30 seconds from sensors on the network. Both arrays (string & double) are allocated when the app starts up (size of double array and labels are read from a config file).
 
Rather than transfer the data from the double array into a cluster array each interval, it seems more efficient to set the numeric indicators' label.text property for each element in the array when allocated. It appears an array indicator does not expose the label property for elements in an array, only the value properties for each element.
 
I was hoping that there was a way to get at the label property for each element in the array.Smiley Sad
0 Kudos
Message 5 of 5
(3,912 Views)