08-22-2011 06:58 AM
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
08-22-2011 07:10 AM - edited 08-22-2011 07:12 AM
Try XOR instead of OR.
08-22-2011 07:47 AM
Here is a different way to do it.
08-22-2011 08:06 AM
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.
08-22-2011 08:16 AM
@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?
08-22-2011 09:19 AM
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
08-22-2011 09:24 AM
Can you post your code?
08-22-2011 09:32 AM
Here is a version that does what you want.
08-22-2011 11:37 AM
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
08-22-2011 12:05 PM
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...