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.
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.
12-05-2014 03:16 AM
Hi.
I have 12 true switches.
The default of them is false, and I need to somehow allow only one of them to be true every time.
To clarify, if for example i click switch no 2 (and turn it to true) at start its ok, because only one is turned on, but when i click on switch no 3 (and turn it to true) then I need it to turn down switch no 2 (switch it to false) instantly.
I have just start studying the software and am not all familiar with all its functions, so I would really appreciate the help.
Thank you 🙂
Solved! Go to Solution.
12-05-2014 03:38 AM
Hello Denny,
You can use Radio Button with enabling the function "Allow no Selection" by right clicking on it.
for your reference I have attached vi, just go through it once.
12-05-2014 06:13 AM
Thank you very much, and can i somehow insert each value of the radio button to a boolean array?
I basiclly wish to insert these radio buttons into a while loop which will work until an "ok button" is pressed and then I need to find out which of these radio buttons is pressed.
Thank you again!
12-05-2014 06:35 AM
Yes Denny,
You can get the the actual valye of this booleans in to a array of boolean. you have to just follow the step as I have shown in this below image.
12-05-2014 06:40 AM
Could you please elaborate the steps? all I understand from here is the for loop... i dont really know the other buttons.
Thank you.
12-05-2014 06:50 AM
Hello Denny,
you just download the snippet (Block Diagram image) and drop it to your VI's Block Diagram you will get the samre code in your VI, this is the one of the feature of LabVIEW.
Here I have taken "Controls []" property of radio button, which you can get it from this path at block diagram right click on radio button>> Create>> Property Node>> Controls []. Same wave you can take "Value" property box also.
12-05-2014 06:56 AM - edited 12-05-2014 06:59 AM
here is another method to react on a radio button:
the top solution creates a boolean array, the lower is how I would use the radio button: the event case just react on the change of the value and the output of the radio button control directly enters a case structure 🙂
12-05-2014 07:02 AM
I really appreciate you help, but im sorry I still have difficulty understanding what to do.
I have tried draggin the image from your second post to the white board and it just copied an url address.
Also , I have followed your instructions from your latest message, and created the contorls[] and value and now i have this:
and i dont know how to procced.
12-05-2014 08:30 AM
When I try to change the name of the Radio selections ( i need to have different names) then the "no selection" connection to the value gives me an error.
What can I do?
And can you please explain me the meaning of this connection?
Thank you very much.
12-05-2014 08:49 AM
the 'No Selection' is only valid if you have set to radio button control to 'Allow no selection' (rigth click in the FP on the radio button frame ...)
If you rigth click the case 'name area' you can create new cases that are already correctly named. You can choose one case to be the default case, or you have to create one case for every button (plus the no selection if aktiv)
Read the LabVIEW help:
Fundamentals, Loops and Other Structures, Executing one or More Sections ... , CASE STRUCTURES: EXEC.........
Maybe start the tutorial(s) and/or just read all of the fundamentals 😉