05-16-2022 10:18 AM
Hi,
I am new to labview and am looking for some help on this.
Here is a picture of a simple program. In this program, the first square button and the second square button are opposite boolean variables. When the first button is switched to true, the second button is switched to false. When the first button is switched to false, the second button is switched to true.
Now here's my question: how do I press either button and have whichever button I didn't press hold the opposite boolean state of the pressed button?
Solved! Go to Solution.
05-16-2022 10:26 AM - edited 05-16-2022 10:27 AM
If you are new to LabVIEW, you've come to the right place.
I would recommend to start with all the learning resource listed at the top of the forum.
First of all, we strongly prefer to see the actual VI instead of pictures.
Any toplevel program required a toplevel while loop with a defined rate. (never use the "continuous run" button. that's just a rare debugging tool.)
LabVIEW does not have "variables" (the wire is the variable!). You have controls and indicators.
In particular, your functionality is already available in the radiobutton control. No need for any code.
Attach your VI (LabVIEW 2020 or lower) and we will show you how.
05-16-2022 10:34 AM
@altenbach wrote:
In particular, your functionality is already available in the radiobutton control. No need for any code.
.
See if this can give you some ideas ....
05-16-2022 10:36 AM
Thank you for your help and advice!
Here is the VI.
05-16-2022 10:41 AM
Sorry, I cannot open VIs in LabVIEW 2021. Consider "save for previous" (e.g. 2020). If the attached code is the same as your earlier image, I don't really need it. Did you look at my example?
If you need to do it the hard way with loose buttons, green wires and lost of logic, you need to use a state machine architecture and some local variables to change the value of controls. Not recommended!
05-16-2022 10:46 AM
Sorry, try this one.
05-16-2022 10:47 AM
Yes, thank you so much for the example, I will try it out right now.
05-16-2022 04:38 PM - edited 05-16-2022 04:40 PM
How about something like this?
BTW: Radio Buttons can do this automatically for you...