Jump to content

XControl UI Update


hooovahh

Recommended Posts

I've only made a few XControls, so I might be missing some key aspect to get this to work properly...or it could be a bug, help me figure out which it is. I have a XControl that has the look as a System Combo Box, and functions very similar to one. It works just fine but I found that if I wrote to the control, using a property node, and the SubVI that the control is in isn't being shown, when I show the SubVI the control is blank, but the Value of the control is what I wrote to it.

Attached is a SubVI that explains what I'm trying to say. Run the VI then set the two controls programatically using the buttons. Then you can read the values of these controls and see that the value you get is the same as you set. Then show the subVI. You'll see that the XControl doesn't have the value you set. Then with the SubVI window open set the XControl again, and you'll see the value change.

This XControl is capable of handling a local variable, or property node value change write, because it works as expected when the UI is shown, but when the UI isn't seen, the control isn't right if I then show it later.

Is this a limit or bug of an XControl? Thanks.

EDIT: Saved in 2011 SP1, and the top level is Main Test.vi

Double Edit: No one asked for a video demonstration but I figured why not: Video.

XControl UI Update.zip

Edited by hooovahh
Link to comment

Welcome to the weird and wonderful frustrating world of Xcontrols.

Presumably they don’t bother to update the display when the FP is closed, but I would have thought that some event should be triggered when you open the FP so you could set the display state. But I couldn’t get your control to work.

Link to comment

I've used XControls a little bit, and every time I think I understand XControls I come across some unexpected behaviour that throws my understanding into doubt.

In your example, the "Data Change" event in the facade VI doesn't fire when the sub VI is not visible, but does fire when the the sub VI is visible. Not sure if this is expected or not.

Everything works OK if you use the "Value (signalling)" property to update the XControl, rather than the "Control value set" method.

XControl UI Update Updated.zip

Edited by mgunning
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.