11-09-2021 06:07 AM
Hi all
I have a property node of a radio button (3 buttons "good, "bad", "ok". I input the reference. I have the "value" as an output. This comes as a variant. In the probe window I can see what button is selected. How can I get this data out of the value-variant? Either as an enum text or as a number of the pressed button. A text like "good", "bad" or "ok".
Thanks for any help.
11-09-2021 08:00 AM
Show some code. If you have a reference to that specific radio button, the Value property node should be the actual value not a variant:
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
11-09-2021 09:20 AM
if I have an Event for one radio button I got a value I can use, with several events the value changes to variant and I have to somehow sort out the pressed button
11-09-2021 09:26 AM
@Robi_F wrote:
if I have an Event for one radio button I got a value I can use, with several events the value changes to variant and I have to somehow sort out the pressed button
That's not code, that's a picture of the code, and a small, tiny picture of an event structure that we can't even look at. My guess is it's not a radio button at all, but three Boolean controls, probably set to "latch when released", maybe in a cluster, maybe not.
11-09-2021 09:39 AM - edited 11-09-2021 09:41 AM
I echo what bill said. We want to help you but we don't want to have to guess, so if you are allowed to, please upload the actual code when you make posts.
My guess (groan) is that you have a single event case that handles multiple radio buttons of different structures. The (far) easiest solution would be to make a separate event case for each one of your Radio Buttons. Then in each event case, the CtlRef that you are using will be the specific to that Radio Button and will therefore give the proper data type.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
11-09-2021 09:45 AM
Sorry folks I didn't want to waste your time. I just realised that when the property node is radioBtnsControl the value output is a variant. When it's radioBtnsControl(strict) it is changing to enum (that's what I want). So I only need to know how I can change a radioBtnsControl into a radioBtnsControl(strict).
11-09-2021 09:49 AM
@Robi_F wrote:
Sorry folks I didn't want to waste your time. I just realised that when the property node is radioBtnsControl the value output is a variant. When it's radioBtnsControl(strict) it is changing to enum (that's what I want). So I only need to know how I can change a radioBtnsControl into a radioBtnsControl(strict).
You are wasting our time NOW, but if you actually upload the code so we can look at it, you will NO LONGER be wasting our time. We want to help, but this is like wanting help from a mechanic but only supplying pictures of your car instead of bringing it in so the mechanic can look at it.
(I still have NO IDEA what you are talking about.)
11-09-2021 09:53 AM
give me some time. It's a large vi and if I take out the interesting part, the problem disappears and I would look like and idiot. So I need some time to prepare the code..
11-09-2021 09:56 AM
@Robi_F wrote:
give me some time. It's a large vi and if I take out the interesting part, the problem disappears and I would look like and idiot. So I need some time to prepare the code..
That will be perfect. Take your time. We also know that sometimes you have to make a mock-up that duplicates the issue.
11-09-2021 09:57 AM
@Robi_F wrote:
Sorry folks I didn't want to waste your time. I just realised that when the property node is radioBtnsControl the value output is a variant. When it's radioBtnsControl(strict) it is changing to enum (that's what I want). So I only need to know how I can change a radioBtnsControl into a radioBtnsControl(strict).
Make a separate event case for each one of your radio buttons, and the CtlRef that you are using will be specific to each radio button (strict).
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.