03-09-2012 11:55 AM
I am trying to enable/disable indices of a system ring during runtime on checkbox events.
I have included a sample VI with the following:
Front Panel
A "Tools Palette" with 2 button controls with a checkbox and a string indicator corresponding to each button control.
BD
On a checkbox value change event
-The visibility of the corresponding button control is set to the value of the checkbox.
-The Name of the currently shown item in the ring control is applied to the corresponding string indicator.
-The Value of the currently shown item in the ring control is stored as an ID for the button control.
-If the checkbox is now true, the index of the currently shown item in the ring control should be disabled.
-If the checkbox is now false, the index of the currently shown item in the ring control should be enabled.
/*The enabling/disabling is done by adding/deleting elements from the DisabledItems[] property.*/
The process seems correct, however, I have only been working with LabView since February so I may be doing something horribly wrong.
Transitioning from a C background has been... interesting.
(Also, I am using Local Variables because I don't know how else to work this problem,
so, unless you can explain how to accomplish the same thing without them, please ignore my LabView no-no)
03-12-2012 05:40 PM - edited 03-12-2012 05:41 PM
Hi goodnaysayer,
Welcome to the graphical programming environment. From your sample VI, you seem to have a good handle on the many features available in LabVIEW. For disabling indices of a Ring, the Disabled Items[] property node would be the tool to do that.
As in any programming environment, there may be multiple ways to solve a problem. As long as your code meets your requirements, you should be fine. In this instance, an alternative to using local variables could be using shift registers.