07-20-2023 11:16 AM
The front panel of my VI allows the user to toggle between US imperial (ft) and European metric (m) units of length.
For numeric indicators on the panel the 'unit label text' property node allows me to switch units programatically to display 'm' or 'ft' as appropriate. I can't however do the same in arrays because, although numeric elements in arrays have unit labels, there doesn't appear to be a corresponding 'unit label text' property node.
Is there a workaround or am I missing something.
I usually Google my way out of such issues because you tend to find and learn more that way but on this occasion I've found nothing.
Using LabVIEW Community Edition 2022 on Windows 10.
Aim for the moon and the stars . . . and if you only hit the outhouse roof at least it's progress in the right direction.
Solved! Go to Solution.
07-20-2023 11:47 AM
Get the array element reference, cast it to a numeric, and then you can manipulate the unit text.
07-20-2023 02:58 PM
Why does something that is so simple and intuitive for a numeric indicator (R.Click>Create>Property Node>Unit Label>Text . . . et voilá) have to be so obscure and convoluted for the same thing in an array?
Thanks for your help. The solution works just fine, and is beyond what I am familiar with in LabVIEW so I would have struggled to get there on my own.
Aim for the moon and the stars . . . and if you only hit the outhouse roof at least it's progress in the right direction.
07-21-2023 02:32 AM
@M31vyn wrote:
Why does something that is so simple and intuitive for a numeric indicator (R.Click>Create>Property Node>Unit Label>Text . . . et voilá) have to be so obscure and convoluted for the same thing in an array?
It doesn't. There are two ways you can create a property node which is implicitly linked to the array element:
The first is to do exactly the process you describe, but the trick is that you have to make sure you right click on the control which is inside the array and not on the array itself.
The second is to right click a property node and select Link to and then navigate the tree of the FP hierarchy until you find the array and select the control which is inside the array.
It should be pointed out that the all the array elements have the same properties (other than the value), so you only have a single control to link to.
07-21-2023 05:08 AM
Awesome stuff. Every day's a school day.
It never occurred to me to click on the object on the front panel (duh!). I spent the day faffing about on the block diagram.
Nor did I think to investigate the Link option. I guess subconsciously I assumed that if what I was looking for wasn't under Property Node then it wouldn't be available through Link either. (Once again, duh!)
I'm not usually this dim, but it was a long day. So again, thanks for the solution, and the lessons. I've learned three new LabVIEW things.
Aim for the moon and the stars . . . and if you only hit the outhouse roof at least it's progress in the right direction.
07-22-2023 09:26 AM
07-23-2023 06:16 PM
Very sturdy. Surely you've heard the expression, "built like a brick ****house". 😀
Aim for the moon and the stars . . . and if you only hit the outhouse roof at least it's progress in the right direction.
07-23-2023 07:12 PM
@M31vyn wrote:
Very sturdy. Surely you've heard the expression, "built like a brick ****house". 😀
I've heard the term, applied to other things by the Commodores.
Nice landing.