jdunham Posted March 7, 2009 Report Share Posted March 7, 2009 OK, so I wrote a very simple (and useless) XControl. All it should do is take a numeric and copy it to a string. From the fresh XControl, the only thing I changed was Facade.vi. I added a Value Changed event for the numeric, which transfers its value to Data Out, and sets Action.Data Changed? = TRUE. I dropped the XControl on a new VI, and changed the numeric. I was expecting the 'Data Change' event to fire right after and update the string value, but the 'Data Change' event never executes. I feel like I'm missing something obvious... Quote Link to comment
LAVA 1.0 Content Posted March 7, 2009 Report Share Posted March 7, 2009 QUOTE (jdunham @ Mar 6 2009, 10:01 AM) I feel like I'm missing something obvious... Yes, that is correct. The 'Data Change' event inside the facade VI is only triggered if the data of the XControl on the owning VI is changed. What you should have done is place the code inside 'Data Change' in the Numeric.Value Change event. The event triggering of Facade event is desribed in it's http://wiki.lavag.org/XControl:Abilities:Facade_Ability_VI' rel='nofollow' target="_blank">wiki page. Ton Quote Link to comment
ASTDan Posted March 7, 2009 Report Share Posted March 7, 2009 We just had a good presentation on Xcontrols at our user group meeting. http://decibel.ni.com/content/groups/south...?view=documents Quote Link to comment
jdunham Posted March 7, 2009 Author Report Share Posted March 7, 2009 OK, Thanks guys. I got thrown by the built-in comment QUOTE If you modify Data Out orDisplay State Out set the appropriate Boolean in Action to TRUE. I thought that would mean that the Data Changed event case would get executed, but now it makes sense; you never get anything for free. I had read the wiki page, but if your understanding is broken like mine was, it doesn't point you back in the right direction. I'll add some text if I can figure out what would have helped me. So the underlying issue is that, for the control I'm really working on, any number of things can happen, and I just want to repaint the whole display whenever the data changes or the state changes or any of the auxiliary facade controls change. Where is the best place to put that code such that it's easy to invoke it from various points on the facade block diagram? Quote Link to comment
LAVA 1.0 Content Posted March 7, 2009 Report Share Posted March 7, 2009 QUOTE (jdunham @ Mar 6 2009, 04:57 PM) So the underlying issue is that, for the control I'm really working on, any number of things can happen, and I just want to repaint the whole display whenever the data changes or the state changes or any of the auxiliary facade controls change. Where is the best place to put that code such that it's easy to invoke it from various points on the facade block diagram? What I normally do is add a field to the XControl's state as a commander. In the timeout event of the XControl I read the command state and redraw if necessary. This can even be done from an XControl property or method. Ton Quote Link to comment
jdunham Posted March 7, 2009 Author Report Share Posted March 7, 2009 QUOTE (Ton @ Mar 6 2009, 09:01 AM) What I normally do is add a field to the XControl's state as a commander.In the timeout event of the XControl I read the command state and redraw if necessary. Fantastic, thanks! Quote Link to comment
SteveChandler Posted May 13, 2011 Report Share Posted May 13, 2011 We just had a good presentation on Xcontrols at our user group meeting. http://decibel.ni.co...?view=documents It says not found. Quote Link to comment
Fab Posted May 13, 2011 Report Share Posted May 13, 2011 It says not found. Try this one: http://zone.ni.com/wv/app/doc/p/id/wv-2695 This was the virtual users group meeting presented on May, 11, 2011 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.