Jump to content

Obtaining Reference To Controls Within A Cluster


Recommended Posts

I recently ran into an issue that I thought I would bring up on the LAVA forums.

When dealing with clusters, I have had situations where I would like to access property nodes on specific controls within the cluster. In the past, I have used the Label.Text to identify the desired control and eventually migrated to a enum typedef representing the "order" of the control. This would allow me to rename the labels without breaking my code and upon re-ordering the cluster, I could just update the typedef which would apply all changes on a global basis.

Are there any other ways of obtaining a strict reference to a control of a cluster that is "absolute" (I don't have to search for the Label.Text in a for loop or use my enum method)? I find it interesting that I can create an implicit reference, yet I cannot obtain a refunum from this property node.

Image:Implicitexplicit.png

Thanks!

Link to comment

Hello,

The easiest way I have found is to right click on the element in the culster and select "Create Property Node". You then get a propery node for the individual control in the cluster.

I have also shown another way of getting the reference to an individual control in a cluster

Hope this helps

Dan

post-8614-1210558553.gif?width=400

Link to comment

QUOTE (jgcode @ May 12 2008, 12:02 AM)

What about trying this?

You can access the element's reference thru the cluster's reference by right clicking

ASTDan, thanks for the reply. I have been currently using the methods you demonstrated (using a enum typedef for the array index). The limitation to this is that if you re-order the controls of the cluster your refnum index is no longer valid.

jgcode, this is exactly what I was looking for! Sometimes you just have to dig a little deeper within LabVIEW because there are so many features.

Link to comment

QUOTE (brianafischer @ May 13 2008, 07:56 AM)

jgcode, this is exactly what I was looking for! Sometimes you just have to dig a little deeper within LabVIEW because there are so many features.

I know what you mean, I used to do what you did or I would unbundle the cluster then make an indicator from the elements just so I could get a reference!

But it was one of those a-ha! moments when we found it.

I have been playing with VI server and refs a fair bit lately - I am constantly amazed at all the things you can do.

Thats why I love LabVIEW :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.