11-29-2011 09:06 AM
I have an enumerator with a list of channel numbers (1,2,3,4,etc). It's a custom control and is used in 6 different locations on my front panel. When i make a channel selection in one, i want that channel number to be disabled in the others. I'm using property nodes and it works but it looks like it can get messy quick with all 6 controls. Is there a beter way to do this? THANK YOU!
11-29-2011 09:54 AM - edited 11-29-2011 09:56 AM
It would help if you posted your actual code. It is hard to suggest improvements without seeing what you have already done. I could simply answer your question with as vague an answer by saying you should write more generalized and efficient code. However since that answer is all but worthless it will be about the best you will get without more information from you.
11-29-2011 10:01 AM
Tried the attached. The except input is just the label of the enum that you do not wish to disable. Let me know if this is what you want.
11-29-2011 10:03 AM
I forgot to mentioned, the attachment is meant to go into a subvi.
11-29-2011 11:05 AM
Thanks for the information. Unfortunately, we are using LabVIEW 2009 cannot open attachment. I am trying to move and modify some code (part of a larger vi) showing what i would like to do with disable enable. Hope to send it soon.
11-29-2011 11:19 AM
I saved it in 2009, see attached.
11-29-2011 11:56 AM
Thanks! I opened it. Very interesting. I keep learning good stuff. ....but what i am trying to do is disable particular item in a enumerater based on selections made in another enumerator. (Like control 1,2,3 and 4 are enumerators with items CH1, CH2, CH3, CH4, CH5 in each of them, in control 1 I selected CH1, now in control 2,3, and 4 CH1 is disabled.)
11-29-2011 12:11 PM
I use a GUI Controller to handle things like that. I have an albumn here showing the code used in a couple of my apps.
The GUI Controllers are generally variations on Action Engines that cache references and/or screen states and allow me to "poke at the GUI" from sub-VIs.
If the functionality is used more than one place then I add an action just to do that work. It would use the cached refs and disable each instance.
have fun,
Ben
11-29-2011 12:14 PM
11-30-2011 10:34 AM
Thanks so much!!! With all your ideas, I came up with a sub vi that is similar. It works pretty good. The sub vi is in a vi that is a producer/consumer-events pattern. So when a channel selection is made it will go to this sub vi. If it is a channel change, it remove the old channel first then add the new. It's attached if anyone is interested. THANKS!