LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output label text of selected Radio Button as string

Solved!
Go to solution

I have a set of radio buttons labeled AB, AC, AD, BC, etc.

 

When one of these buttons is selected it displays the text selected in a box at the bottom "AB", "AC", etc.  This is a feature, not something I did.

 

I want to access that text directly and feed it into a string for file storage.  However, there is no terminal associated with that display, so I can't wire it to anything.

 

Is there any way, perhaps via a property, I can extract that text information?

0 Kudos
Message 1 of 19
(7,412 Views)

A radio button group is an enumeration, so you can connect the terminal (or a local variable) to "Format Value" with the format string set to "%s" and you'll get the corresponding text.

0 Kudos
Message 2 of 19
(7,411 Views)

The value that comes out of my Radio Button group is an unsigned word.  When I connect this to the value input of Format Value and set the format string to "%s" (without quotes), it simply gives me the integer value of the button selected, i.e. 0 to 5.  I need the text that appears in the box at the bottom of the radio button group.

0 Kudos
Message 3 of 19
(7,407 Views)

What version of LabVIEW are you using?  Can you share your code?  Can you provide any more information about this mysterious text box that you mention?  This works for me:

get radio button text.png

0 Kudos
Message 4 of 19
(7,403 Views)

Can you post a simple VI that contains your radio buttons control with the label display?  The Radio Buttons control in LabVIEW is an enumerated type...if you've got radio buttons on the panel that display a string containing the selected value, and return a numerical value instead of an enum value on the diagram, it sounds like you may have a non-standard implementation of radio buttons, like an XControl, or a cluster of booleans with some code behind them.

0 Kudos
Message 5 of 19
(7,400 Views)

It's just a standard Radio Buttons (codeless) control, there is no code behind it (at least none that I wrote).  I have indicated in the initial posting where the "mysterious" text box is located with an arrow. It appeared next to the buttons on the right side, when I placed the control on the front panel.

0 Kudos
Message 6 of 19
(7,398 Views)

Was there supposed to be an image included with your original post?  I don't see one, nor do I see any arrow.  If you used a third-party site to host the image, please use either the Insert Image feature (the "tree" in the toolbar) or add it as an attachment to your post instead.

0 Kudos
Message 7 of 19
(7,393 Views)

@wildcatherder wrote:

It's just a standard Radio Buttons (codeless) control, there is no code behind it (at least none that I wrote).  I have indicated in the initial posting where the "mysterious" text box is located with an arrow. It appeared next to the buttons on the right side, when I placed the control on the front panel.


You haven't described a "standard" Radio Buttons control, and you haven't illustrated anything you said with an image.  Ideally, you would have included a sample VI in your original post and we would have solved the problem by now.

 

0 Kudos
Message 8 of 19
(7,386 Views)

I don't know what happend to the original image.  I definitely did the "Choose File" before post.

 

Anyway, I have attached an image showing my application, how I found this control by searching for "Radio".  Since I did find it in the list of controls and did not do anything to it but change the number of entries and their labels, it is as "standard" as Radio Buttons (codeless) is going to get.  There is no "code" to post.  I simply want to take the output and extract the text that appears in the selection box provided on the control.

 

If it can't be done, it can't be done.  If you can't help, let someone else try.

0 Kudos
Message 9 of 19
(7,365 Views)

I checkied it my LV2011 but am not getting what you got. Which version of LV you are using (Just curious to know).

-----

The best solution is the one you find it by yourself
0 Kudos
Message 10 of 19
(7,361 Views)