LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two switches both controlling each other

Solved!
Go to solution

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?

Screenshot (4).png

0 Kudos
Message 1 of 8
(1,254 Views)

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.

0 Kudos
Message 2 of 8
(1,245 Views)
Solution
Accepted by topic author kadinrk

@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 ....

 

altenbach_0-1652715277728.png

 

Message 3 of 8
(1,230 Views)

Thank you for your help and advice!

Here is the VI.

 

0 Kudos
Message 4 of 8
(1,227 Views)

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!

0 Kudos
Message 5 of 8
(1,222 Views)

Sorry, try this one.

0 Kudos
Message 6 of 8
(1,212 Views)

Yes, thank you so much for the example, I will try it out right now.

0 Kudos
Message 7 of 8
(1,209 Views)

How about something like this?

 

BTW: Radio Buttons can do this automatically for you...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 8
(1,165 Views)