08-09-2017 08:35 AM
Is there any way to get the functionality of a radio button (when you select one it clears the last selection) from an array of Boolean controls? I am using a touch panel and the radio buttons are not very user friendly but I still want that kind of functionality.
I was also wondering if there was a way to disable a control until another was selected. right now the controls on the UI are the controls that are populated when you drag and drop a networked published variable but I could just as easily run standard controls that feed into the network published variable.
Thanks,
Larry
08-09-2017 08:41 AM
@LawrenceD wrote:
I am using a touch panel and the radio buttons are not very user friendly but I still want that kind of functionality.
Then just put whatever Boolean controls you want in the Radio Button.
08-09-2017 08:41 AM
Hi Larry,
Is there any way to get the functionality of a radio button (when you select one it clears the last selection) from an array of Boolean controls?
Yes, sure: check for value change events of your button array and clear all buttons except the one that created this event…
I am using a touch panel and the radio buttons are not very user friendly but I still want that kind of functionality.
You know you can customize every control? Replace the booleans in the radio button by bigger ones…
08-09-2017 11:49 PM
Share the Code Snippet for VI of yours.
Hope you can use radio Button Itself with adding More Buttons into it, if you explicitly want An Boolean array to perform your operation use the Event Structure Detect the event change keep the latest element true and make rest false.
08-10-2017 09:15 AM
You cannot disable single/multiple element of an array since all element shares same property node. Only the difference between elements in an array is in their values. So you may have to go to some other options.
08-10-2017 09:54 AM - edited 08-10-2017 09:59 AM
@LawrenceD wrote:
Is there any way to get the functionality of a radio button (when you select one it clears the last selection) from an array of Boolean controls? I am using a touch panel and the radio buttons are not very user friendly but I still want that kind of functionality.
As others have said, a radiobutton control accepts any number of booleans and a mix of any kind of booleans . A good description can be found in the first paragraph of this idea.
(unfortunately, the radio button controls needs to contain at least one booleans at all times, but that's a different discussion)
Still, radiobutton functionality can be implemented with boolean arrays, but they have the disadvantage that each element needs to look the same (boolean text, etc). Of course if you do your own code, you can also have slightly modified functionality. I once did a 2D array of buttons where the last two pressed buttons were true. Then, whenever a new one was pressed, the oldest turned off.
@LawrenceD wrote:
I was also wondering if there was a way to disable a control until another was selected. right now the controls on the UI are the controls that are populated when you drag and drop a networked published variable but I could just as easily run standard controls that feed into the network published variable.
Is this a completely unrelated second question or does it still have to do with radio buttons or arrays?
What does "populated" mean in this context? A network published variable is not a control so I am confused by your description. It does not live on the UI.
It would help if you could show us an example?
08-10-2017 10:36 AM
@altenbach wrote:
@LawrenceD wrote:
I was also wondering if there was a way to disable a control until another was selected. right now the controls on the UI are the controls that are populated when you drag and drop a networked published variable but I could just as easily run standard controls that feed into the network published variable.
Is this a completely unrelated second question or does it still have to do with radio buttons or arrays?
What does "populated" mean in this context? A network published variable is not a control so I am confused by your description. It does not live on the UI.
It would help if you could show us an example?
I have gotten the radio button figured out and implemented as the others said.
The question about enabling and disabling a control is indeed a separate question from the radio buttons and I am not trying to disable a portion of the radio button control. what I have is controls that enable various stepper drives and then a control that starts the movement but I have found that if you accidentally hit the start move button and then try to enable the drive it outputs an error and stops the VI. what I want to see if it is possible is to disable the start move button until there is at least one of the drives enabled so that you can not press them out of order. however at the moment my controls are what is populated when you drag a network published variable from the project screen onto the front panel of the VI and so it seems to behave slightly differently from a normal Boolean control because it is the Boolean control wrapped up with the input to the network variable. I could redo the UI VI to have the Boolean controls separate in the code from the input to the variable if need be but still need to have a way to disable the start move button until a drive is enabled.
08-10-2017 10:39 AM - edited 08-10-2017 10:45 AM
As others have mentioned, the individual elements of an array can't be disabled, though that isn't what a radio button type does, it just only allows one at a time to be selected. If you meant can you disable other controls until a specific one has had a selection, yes.
Late reply, busy making a snippet, then unsuccessfully trying to insert it.
08-11-2017 12:05 AM
Hi,
I have implemented the functionality using Push Button. When you turn on one Push button all other will be disabled and when you turn it off all others will be enabled. Please let me know if there is anything which will improve my implementation .
08-11-2017 12:56 AM - edited 08-11-2017 12:57 AM