Go to Post No! I will not be an enabler for this madness. Go outside. See a movie. Read a book. LIVE!!!! - Herodotus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2009, 22:32
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
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   Spotlight this post!  
Unread 31-01-2009, 22:50
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
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.
Attached Files
File Type: vi RelaySet.vi (9.5 KB, 26 views)
  #3   Spotlight this post!  
Unread 01-02-2009, 00:20
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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   Spotlight this post!  
Unread 01-02-2009, 04:48
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 21:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi