LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Assign a value to the radio button selection

Solved!
Go to solution

Hello dear all,

 
I have several radio buttons (20) (but I put only 2 here for simplicity)
I want when I select or click on a selection (for example on concentration) that its value is 1 and Entertainment value is 0.
Then I have to save it on a text file as follows:
Concentration: 1
Entertainment: 0
How do I do it please?
0 Kudos
Message 1 of 11
(1,489 Views)

Use the radiobutton to index into an array of values.

 

If you want to format the value as integer instead of the element string, just convert to e.g. U32:

 

altenbach_0-1673910600895.png

 

0 Kudos
Message 2 of 11
(1,466 Views)

Thank you for your answer @altenbach.

I think you have understood what I want.
Let's start with a single radio button.
When I click on Concentration its value =1 and the other one (enterntainment) that I did not click its value =0
Ps: I am still on the same radio button.
Below the file.txt that I have by clicking on concentration then on save and what I want to have.
 
I do not know is it clear?
 
I have thought of several scenarios but I do not know how to do it.
Thanks
0 Kudos
Message 3 of 11
(1,424 Views)

Try this:

 

altenbach_0-1673969926295.png

 

0 Kudos
Message 4 of 11
(1,395 Views)

And if you want all states, here's one possibility:

 

(see below)

 

0 Kudos
Message 5 of 11
(1,391 Views)
Solution
Accepted by topic author Ngouda

It is really not clear what you want, because only one selection can be true at any time, but if you want a "1" for the selected item and "0" for all others in that radio-control, here's one possibility:

 

altenbach_0-1673970852548.png

 

 

 

0 Kudos
Message 6 of 11
(1,382 Views)

@Ngouda you should give a kudo and accept a solution. It's also a way of showing gratitude besides saying "thank you".

0 Kudos
Message 7 of 11
(1,367 Views)

Dear @altenbach

Thank you very much, it works as I wanted it to.

Good evening to you

Thank you.

0 Kudos
Message 8 of 11
(1,358 Views)

@GRCK

I don't understand the meaning of your answer.

I think it's obvious that I was going to answer him as soon as I could and thank him and accept it as a solution, because he took his time to answer me and help me for free with a lot of kindness.

Thanks again @altenbach

Message 9 of 11
(1,354 Views)

Thanks for answering! Now you understand the meaning of my answer. 😂

By the way, we are twins (same profile picture) Hahah.

0 Kudos
Message 10 of 11
(1,346 Views)