02-20-2019 12:37 PM
Hi I am new to LabVIEW. I found an example where when a radio button was pushed it puts out an integer instead of T/F. How do I create such a button. I cant find anything under properties for the radio button that does this. thanks
02-20-2019 12:48 PM
There are two categories of radio buttons. One drops by itself and looks like a single circle or square with text next to it. This is likely what you're using and is true/false only.
The other category is radio buttons that look like a box, with 2 circles in it. That one outputs an integer (an enum, really) and is what you want.
The one you want is only in the "Classic" and "Modern" controls, so if you default to using System or Silver, you might not see it.
02-20-2019 01:00 PM
@AZ_Cowboy wrote:
Hi I am new to LabVIEW. I found an example where when a radio button was pushed it puts out an integer instead of T/F. How do I create such a button. I cant find anything under properties for the radio button that does this. thanks
You might be confused by the term "radio button". A simple boolean outputs T or F and they are typically called switches or buttons when used as controls.
A radiobutton control is a selection of more than one boolean for which only one can be true and pressing a different one makes the current one false (there is also an option to allow no selection if desired). You can place any number and type of booleans in it. The output is basically an enum containing the labels of the boolean controls as items. An enum is not an integer, but you can still use it as one under some conditions, e.g. by wiring it to the index of "index array", etc. You can also do simple math, such as +1 or -1 and it will cycle through the items.
So, to get better help, show us what "example" you found (link, example finder, name, etc.). You can even attach the VI here.
02-20-2019 01:17 PM
the example I was looking at is call RadioSel.vi. I found it while doing a search in a forum. What I am doing is trying to mimic a touch pad. btw where is the user library.
02-20-2019 01:31 PM
Yes, that's a simple radio-button container as described, containing three buttons. ALso look at my above link. The labels of the buttons are hidden, but they define the items of the enum. The output is NOT an integer!
While it is convenient to wire the enum to a case structure for more complicated code paths, the example could be redone as follows in this case if you chose the labels right (... more or less, there is a difference for "no selection").
The "user library", a defined location in the palettes, is blank by default and intended as a place for your own tools.
02-20-2019 01:32 PM
I think this would get you close to what you are looking for.
02-20-2019 01:37 PM
@aeastet wrote:
I think this would get you close to what you are looking for.
That's quite different, because you will have 2^N possible outputs. To have it act as radiobutton (only one selection allowed) would require more code and maybe "search array" to get the index.
There are also hard limitations, for example you cannot have more than 64 elements.
02-20-2019 01:40 PM
Yes you are right unless you can choose multi inouts. Then you can just read the output and react however you want. It isn't exactly a radio button. Just throwing out some ideas.