LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Button Functionality from Boolean Control Array

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

0 Kudos
Message 1 of 12
(4,741 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 12
(4,736 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 12
(4,735 Views)

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.

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 12
(4,686 Views)

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.

 

 

 

0 Kudos
Message 5 of 12
(4,671 Views)

@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?

 

0 Kudos
Message 6 of 12
(4,663 Views)

@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.

0 Kudos
Message 7 of 12
(4,653 Views)

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.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 8 of 12
(4,651 Views)

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 .

 

 

 

certified-labview-associate-developer (1).png

0 Kudos
Message 9 of 12
(4,624 Views)

Hi racahmd,

 

Please let me know if there is anything which will improve my implementation .

Use radio buttons instead!

No need for collecting references and putting an event structure just to handle 4 buttons…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(4,618 Views)