LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting at unique labels for cluster contents?

Hello,
 
I am trying to figure out how to get at the identity (in the form of a text string) of controls inside of clusters.  I've been told that the identity of controls inside clusters is linked to the parent cluster, so they are unique.  I can see evidence of this when I configure an event structure value change case on a numeric inside a cluster.  I get something like  "MyCluster.MyNumeric Value Change" in the event description box. 
 
My question is, how can I get at this string: "MyCluster.MyNumeric", instead of just "MyNumeric", which in my application is not guaranteed to be unique.?
 
See attached block diagram comments.
0 Kudos
Message 1 of 6
(2,923 Views)
Hi

Property Node of Clusters have an array Contols[]. Pass them into a for loop and use a property node there to question their label. Then you can compare them with the text you look for, don't forget to close the references of the unwanted controls in the loop. The one you got can be type casted to have access to all properties.
(All functions are on the application palette)

Felix
Message 2 of 6
(2,918 Views)

When I do that (pass Controls[] into a for loop and collect the Label Text), all I get is the label of the individual controls --->without reference to the owning cluster.

That is, all I get is "MyNumeric" and "MyBoolean".  What I want to get is the same thing that shows in the event case description box when an event is configured for a value change event, for example: "MyCluster.MyNumeric".

What I want is the whole "dot-delimited" label.  I know is exists somewhere inside LabVIEW because the event case uses it. 

0 Kudos
Message 3 of 6
(2,914 Views)
You may have to create it yourself. Simply get the label of the cluster and concatenate the string with the "dot" and the label of the inner control.

Lynn
Message 4 of 6
(2,909 Views)

Lynn,

I think you are right.  I can use the "Owner" property and then get the label of the parent cluster, and the concatinate by hand.  I was hoping there was a "magic" property node I could get at.  Oh well...

0 Kudos
Message 5 of 6
(2,888 Views)

Jeffrey wrote "I think you are right. "

Of course he is right.

You can not answer 1700+ plus questions while maintaining a 4.8 average and not be rihgt most of the time. Smiley Very Happy

Have fun,

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(2,878 Views)