|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
boolean equations to relay commands
Hi, I'm controlling one relay using two buttons. When one button is pushed the relay is set to forward, when the other button is pushed, the relay is set to reverse. When niether buttons or both buttons are pushed the relay is set to off. I've written up a couple boolean equations for forward and reverse. Here they are
F=A + (notB) R=B + (notA) However, since the relay set vi doesnt except a boolean, im not sure how to actually set the relay direction using these equations. Does anyone know how to do this? |
|
#2
|
|||
|
|||
|
Re: boolean equations to relay commands
I've attached some pseudo code that might do it for you. The basic thought is to use a case structure to convert your two booleans into the values you need for the set command.
|
|
#3
|
|||||
|
|||||
|
Re: boolean equations to relay commands
To simply use a boolean result to select between two values of another type, I think a case structure is overkill. Using a "boolean selector" is easier and results in code that can be seen all at the same time. Here's an example of it in use:
![]() Ignore the surrounding loop and associated shift registers, and focus on the boolean input to the selector. When it is true, the top numeric input appears on the output; when it is false, the bottom numeric input appears on the output. This works with relay constants just as well as it does with numbers. |
|
#4
|
|||
|
|||
|
Re: boolean equations to relay commands
wonderful! When I tried putting a boolean selector in my code I wasnt sure how to define the true and false cases as the relay input values. I was able to set the inputs as constants, but I realize that that is not what the set relay vi needs.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Boolean searches | Brandon Martus | Announcements | 8 | 10-05-2006 09:16 |
| Relay Commands | Matt Krass | Programming | 6 | 18-02-2006 23:03 |
| boolean problems | Andrew Blair | 3D Animation and Competition | 6 | 26-07-2005 19:44 |
| boolean | atmaturen | Programming | 8 | 28-12-2004 12:49 |
| Boolean statement | blindguyinanorg | Programming | 2 | 15-02-2004 07:31 |