Aitor Solar Posted May 24, 2007 Report Share Posted May 24, 2007 It seems automatic upcasting doesn't work with XControls (see attached image), it's necessary to explicitly upcast to Control class. But I don't know if it's a bug or another strange XControl thing particular of my machine. Anybody else? Saludos, Aitor Umm, it seems if the XControl reference is connected to the first terminal of the build array node, it works, but if it's on another, it fails... Saludos, Aitor Quote Link to comment
Aristos Queue Posted May 24, 2007 Report Share Posted May 24, 2007 This was reported to R&D (# 49MCUJJ1) for further investigation. Quote Link to comment
Aitor Solar Posted May 25, 2007 Author Report Share Posted May 25, 2007 QUOTE(Aristos Queue @ May 23 2007, 09:03 PM) This was reported to R&D (# 49MCUJJ1) for further investigation. Thanks, Aristos. Now I have found an ugly bug with XControls. XControl value property doesn't work if the XControl is disabled. I've looked in the NI forums and is a known issue: http://forums.ni.com/ni/board/message?board.id=170&message.id=177819' target="_blank">http://forums.ni.com/ni/board/message?boar...ssage.id=177819 Now the question is: has been this bug corrected in LV 8.2.1? I have my app almost finished and so I haven't updated to 8.2.1, but I'd do it if that's the solution. If not... If not this would be a big, big problem, since I need to update an XControl value from another VI when that XControl is disabled I have attached a very simple test VI. If anybody can test it in LV8.2.1 I would be grateful. Saludos, Aitor Quote Link to comment
Ton Plomp Posted May 25, 2007 Report Share Posted May 25, 2007 QUOTE(Aitor Solar @ May 24 2007, 12:24 PM) If anybody can test it in LV8.2.1 I would be grateful. Not fixed, Ton Quote Link to comment
Aitor Solar Posted May 25, 2007 Author Report Share Posted May 25, 2007 QUOTE(tcplomp @ May 24 2007, 03:43 PM) Not fixed, Great :thumbdown: Thanks, Ton Saludos, Aitor Quote Link to comment
PJM_labview Posted May 25, 2007 Report Share Posted May 25, 2007 Well there is an easy work around: - Enable you control - Update value - Disable control You might even benefit from using deferring the panel update (this might hide the fact that you are enabling your control briefly) PJM Quote Link to comment
Aitor Solar Posted May 26, 2007 Author Report Share Posted May 26, 2007 QUOTE(PJM_labview @ May 24 2007, 08:48 PM) Well there is an easy work around:- Enable you control - Update value - Disable control True, but there are also some minor problems with that: 1) If you try to change a disabled XControl, not only fails but, after that, keeps failing even if you enable it again, until the user interacts with it (or until you close the VI and open it again). I'm assuming the XControl remains in some kind of internal bad state. So if you are not careful enough and forget to remove just one case of "set value while disabled", you can make your XControl useless for the rest of the application. 2) My XControl is not disabled itself, but inside a disabled tab control. So I have to carry around the tab control refnum to enable and disable it (or get the XControl owner object to enable / disable it). It can be done, but doesn't seem very efficient since there are a lot of XControl instances (almost all the numerical controls/indicators) and I don't know if they are enabled or not . Anyway, I'll implement some similar solution and hope not to forget anything . Thanks. Saludos, Aitor Quote Link to comment
ragglefrock Posted May 31, 2007 Report Share Posted May 31, 2007 QUOTE(Aitor Solar @ May 25 2007, 02:12 AM) True, but there are also some minor problems with that: 1) If you try to change a disabled XControl, not only fails but, after that, keeps failing even if you enable it again, until the user interacts with it (or until you close the VI and open it again). I'm assuming the XControl remains in some kind of internal bad state. So if you are not careful enough and forget to remove just one case of "set value while disabled", you can make your XControl useless for the rest of the application. 2) My XControl is not disabled itself, but inside a disabled tab control. So I have to carry around the tab control refnum to enable and disable it (or get the XControl owner object to enable / disable it). It can be done, but doesn't seem very efficient since there are a lot of XControl instances (almost all the numerical controls/indicators) and I don't know if they are enabled or not . Anyway, I'll implement some similar solution and hope not to forget anything . Thanks. Saludos, Aitor Hmmm... you might consider as a workaround creating your own property for your XControl called myDisable. It would have the same inputs (0, 1, 2) as the regular Disable property for a control, but all it would do is turn around and disable the actual controls on the Xcontrol panel instead of disabling the XControl itself. It would have the same affect, but technically your XControl itself would not be disabled, so the Value property wouldn't be affected. Obviously the problem with this approach is that if you're disabling a number of controls together using an array of references, then you'd have to check which references aren't normal controls and call your version of the disabled property node instead of the regular one. Just a thought... 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.