Jump to content

Control Name from Variant Data - Value Change Event


Recommended Posts

In the attached example, I'm having trouble figuring out why the references Traverse G - objects.vi returns for typedefs do not have the control name embedded in variant data when they are registered for Value Changed Events (enabled diagram).  It seems to work fine for controls that are not typdefs.  If I explicitly find the controls using VI panel properties (disabled diagram), everything works fine but I have situations where the traverse Gobjects would be preferred since it can go through nested tabs / controls etc.  Am I missing something simple.

Typedef Value Change.vi

Link to comment

Wow that is strange.  So all methods to try to get this information out of the New Value, is going to fail because that information simply isn't there for some reason.  OpenG has a few methods, and NI has newer Variant functions in 2015 and those also won't work.  There is also a few methods to disconnect type defs but that doesn't seem to help.  One method that does work, but might not be desired is to use the control reference in the event, then go to a property node and read the Value then get the name from this.  I'd recommend getting the name the way you currently have, and then use this method if the name is empty.  You can also use another function to determine if the variant is a type def, and if it is then use the property node method.

Link to comment
9 hours ago, hooovahh said:

One method that does work, but might not be desired is to use the control reference in the event, then go to a property node and read the Value then get the name from this.  I'd recommend getting the name the way you currently have, and then use this method if the name is empty.  

Thats where I was headed, but wasn't sure what the downsides to using the control reference were (other than speed I presume).

 

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.