bbean Posted May 31, 2016 Report Share Posted May 31, 2016 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 Quote Link to comment
hooovahh Posted May 31, 2016 Report Share Posted May 31, 2016 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. Quote Link to comment
bbean Posted June 1, 2016 Author Report Share Posted June 1, 2016 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). Quote Link to comment
hooovahh Posted June 1, 2016 Report Share Posted June 1, 2016 That's the only downside I can think of is the thread swapping/performance. Still not sure why it works this way, it could be a bug, I'd post on the NI forums and see if you get the attention of someone at NI. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.