Jump to content

XControl... just not getting it


Recommended Posts

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...

Link to comment

OK, Thanks guys. I got thrown by the built-in comment

QUOTE

If you modify Data Out or

Display 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?

Link to comment

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

Link to comment
  • 2 years later...

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.