hooovahh Posted September 24, 2012 Report Share Posted September 24, 2012 (edited) 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 September 24, 2012 by hooovahh Quote Link to comment
asbo Posted September 24, 2012 Report Share Posted September 24, 2012 I *think* that for an XControl to be "running", it has to be displayed. I don't think they can be used in a FGV-esque style. edit: And I have almost immediately found something to the contrary: http://forums.ni.com/t5/LabVIEW/XControl-Shared-Variable/m-p/600606#M280070 Quote Link to comment
drjdpowell Posted September 24, 2012 Report Share Posted September 24, 2012 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. Quote Link to comment
mgunning Posted September 24, 2012 Report Share Posted September 24, 2012 (edited) 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 September 24, 2012 by mgunning 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.