From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controlling radio buttons

Solved!
Go to solution

Can radio buttons be programmatically controlled?

 

If x happens the radio button X is selected, if y happens then radio button y is selected.

 

This would occur automatically in the VI.

 

Thanks

 

0 Kudos
Message 1 of 5
(3,894 Views)

Of course. See the answer to an identical question today.

0 Kudos
Message 2 of 5
(3,880 Views)
Solution
Accepted by rcard53762
As noted, the link provides the general method for controls. Specifically to the radio button: the datatype of a radio button is essentially an enum. You can just wire an integer value to indicate which one you want selected, or better yet, typedef the radio button control and then you can use enum values directly on the diagram, providing self-documentation.
Message 3 of 5
(3,877 Views)

Hi I have the same question as the user previously stated. I read the accepted solution and was just wondering if I could get more clarity on the topic as to how to control radio with the enum.

0 Kudos
Message 4 of 5
(3,330 Views)

Hi Arhakore,

 

more clarity on the topic as to how to control radio with the enum.

This will work like any other control too: you can set its value by writing to a local variable of the control.

To get the correct enum for your radiobutton you just need to right-click the terminal of this button and create a constant. (Or you just place the typedefinition, which you created with your radiobutton, in your block diagram…

 

All this is basic LabVIEW stuff so I recommend the free lessons to learn LabVIEW.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 5
(3,328 Views)