ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling two boolean buttons

Hello,

 

I have two boolean buttons that electrically control one signal (tied together) I need either button to turn off or on the output. I can get the on state no problem using an OR gate but I am have trouble turning them both off with either button. I thought it should have been easy. There must be an easy solution but nothing comes to mind. Any ideas would be welcome.

 

Thanks,

John

0 Kudos
Message 1 of 22
(5,825 Views)

Try XOR instead of OR.  Smiley Happy

 

xor_BD.png

0 Kudos
Message 2 of 22
(5,819 Views)

Here is a different way to do it.

Tim
GHSP
0 Kudos
Message 3 of 22
(5,809 Views)

Well, either one will turn it on or off BUT if both are on the output goes off not what I need. I need If both are on and either one button is pressed then it turns off the output.

0 Kudos
Message 4 of 22
(5,802 Views)

@JTShaw wrote:

Well, either one will turn it on or off BUT if both are on the output goes off not what I need. I need If both are on and either one button is pressed then it turns off the output.


So if I understand:

 

Start Condidtion = off

1 button on = on

or

2 buttons on = on

 

If both are on and one is turned off = off

or

If the one button that is on is turned off = off

 

Correct?

 

Tim
GHSP
0 Kudos
Message 5 of 22
(5,796 Views)

Hey Tim,

 

Yes you are correct, yours works, I would have liked to do it with just bools but seems a little tricky. Thanks for your example, I'm not sure how easy it would be be integrate into my application.

 

Cheers,

John

0 Kudos
Message 6 of 22
(5,777 Views)

Can you post your code?

Tim
GHSP
0 Kudos
Message 7 of 22
(5,772 Views)

Here is a version that does what you want.

Tim
GHSP
0 Kudos
Message 8 of 22
(5,766 Views)

Hi Tim,

 

Here is the subvi that I need to fix. I can't send the whole code as it is for our research reactor. Your last solution works perfect. I just need to implement it into my code somehow. Thanks for your help.

 

John

0 Kudos
Message 9 of 22
(5,748 Views)

Can you tell me exactly what you need it to do. I did two inputs but now I am understanding that there are 6?

 

What is the input to this VI? Is it the cluster with eight controls?

 

What is the expected result that you expect for each condition?

 

1 on = 1 on out

1 & 2 on = 1 on out

3 on = 2 on out

3&4 on = 2 on out

etc...

Tim
GHSP
0 Kudos
Message 10 of 22
(5,738 Views)