Go to Post I once heard someone say that Dean is "building an army of engineers." I disagree. I think he is building an army of the informed. - Gope [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2009, 12:23
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Programming 2 buttons for a relay

Hi, I'm trying to get button one on my controller to make the relay go forward, and button 2 on my controller to make it go in reverse. I have a picture of what i have so far and if anyone else can remake this picture and put in the changes it needs to make this works that would be great!

Thank you
Attached Thumbnails
Click image for larger version

Name:	Robot relay.JPG
Views:	189
Size:	41.5 KB
ID:	7362  
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2009, 12:56
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Programming 2 buttons for a relay

Keep in mind that the way you wrote it, the optional code is producing the constant, but you are still calling the relay function regardless of what the buttons do. In fact you are calling it twice. Try putting the subVI inside of the case statement too. That way if button one, you send the one value to the relay. In parallel, if button two, send the other command to the relay. If neither button, don't do anything to the relay.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 08-02-2009, 13:03
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Re: Programming 2 buttons for a relay

Is it possible for you to put this into labview, and send it over as a picture. I'm an 18 year old with about 0 experience on LABVIEW and officially don't know what i'm doing.
Reply With Quote
  #4   Spotlight this post!  
Unread 08-02-2009, 13:06
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Programming 2 buttons for a relay

Not super easy. If you open the diagram that you took a picture of, click on the relay and drag it to the left into the case structure next to it. Then reconnect the pink wire to the upper left. Then do the same to the other relay. Then test.

Greg McKaskle
Reply With Quote
  #5   Spotlight this post!  
Unread 08-02-2009, 13:12
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Re: Programming 2 buttons for a relay

I tried it, and it didn't work. What happens is button 1 will do the reverse command, but button 2 remains unresponsive.
Reply With Quote
  #6   Spotlight this post!  
Unread 08-02-2009, 13:30
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Programming 2 buttons for a relay

I suspect the code is doing what you told it, just not what you wanted. If you right click, you can set a breakpoint on the relay function inside the case for button two. Then you will know for sure that the button is setting the relay off.

The next question is, what does turning off the relay really do on your robot.?Is that the right thing to do? Changing the constant to other values may be the right thing. Be safe, especially if this is controlling pneumatics.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 08-02-2009, 13:47
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Programming 2 buttons for a relay

Have you tried the diagram detailed in the image?

You would need to change the Reverse to Off, and in the True Case, set the relay to Reverse.
Attached Thumbnails
Click image for larger version

Name:	relay 2 button.JPG
Views:	120
Size:	6.0 KB
ID:	7365  
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."

Last edited by paulcd2000 : 08-02-2009 at 13:54. Reason: Re-examined first image
Reply With Quote
  #8   Spotlight this post!  
Unread 08-02-2009, 14:20
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Re: Programming 2 buttons for a relay

But, i would need to put the "and" function into both cases? or do i only need one?
Reply With Quote
  #9   Spotlight this post!  
Unread 08-02-2009, 14:26
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Programming 2 buttons for a relay

well, the "and" block is outside the case structure. so you shouldn't need to put in two of them.
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
Reply With Quote
  #10   Spotlight this post!  
Unread 08-02-2009, 14:43
team877's Avatar
team877 team877 is offline
Registered User
FRC #0877 (Cub Robotics)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2001
Location: North Dakota
Posts: 52
team877 is an unknown quantity at this point
Re: Programming 2 buttons for a relay

But how do i set it between, forward, off, and reverse, or will it do that automatically
Reply With Quote
  #11   Spotlight this post!  
Unread 08-02-2009, 14:55
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: Programming 2 buttons for a relay

ok, inside the case structure, True will execute when both are pushed, and false will execute if anything else is pushed. inside of that, pick which one you want it to do. just change where it says "reverse" or "off" or whatever.
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
Reply With Quote
Reply


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
Programming a relay in C++ Kage C/C++ 2 10-01-2009 17:51
Programming a single relay to two buttons in easyC Pro? Gizmo2417 Programming 1 17-02-2008 17:10
Help Programming Buttons LordFrz Programming 3 14-02-2008 13:55
Easy C Relay Programming Team_486 Programming 1 26-03-2007 15:01
Relay Programming Questions... comwiz7 Programming 11 21-02-2006 13:04


All times are GMT -5. The time now is 15:12.

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