Go to Post Creatively solving problems is part of the fun. Continuous improvement and sustainment of [old] programs is also important. - tim-tim [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, 15:14
BLAQmx's Avatar
BLAQmx BLAQmx is offline
Software Engineer
no team (National Instruments)
Team Role: Engineer
 
Join Date: Sep 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 100
BLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of lightBLAQmx is a glorious beacon of light
Re: Programming 2 buttons for a relay

We've worked a couple of examples demonstrating programming joystick buttons for different robot functions.

Joystick Button Control (Using a Functional Global Variable)
__________________
NI FIRST Community: Where to go for LabVIEW, Wind River, cRIO-FRC, and NXT support.
Reply With Quote
  #2   Spotlight this post!  
Unread 08-02-2009, 15: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
Re: Programming 2 buttons for a relay

Hi, Here is some code that avoids using case statements since it seemed overkill. We ran into the problem in which the red light would appear to be blinking at a fast rate and flickering. We resolved this issue by ensuring that a relay command is given only once during each execution. We did this by using select blocks. The true and false signals are enum constants in which I just copied from the relay set vi (right click on the input for the relay set vi and create as constant then make multiple copies of that to put as inputs to the select blocks). For our code, we set one button for forward and another for reverse. When either both or none of the buttons are pressed, the relay defaults to the off state. We are actually controlling two relays with the same control signals so you will see two relay set vis, just ignore the second one. I attached a picture.

This was a little too much but for forward and reverse we created boolean equations that are represented by the logical ands and ors that you see in the code.

I really hope this helps! If you have further questions feel free to ask!
Attached Thumbnails
Click image for larger version

Name:	button example.JPG
Views:	107
Size:	34.2 KB
ID:	7367  
Reply With Quote
  #3   Spotlight this post!  
Unread 17-02-2011, 22:09
LatinDrummaBoy LatinDrummaBoy is offline
Registered User
FRC #3518
Team Role: Student
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Lecanto FL
Posts: 3
LatinDrummaBoy is an unknown quantity at this point
Question Re: Programming 2 buttons for a relay

Hello, Im having some issues with something similar to this. I have 2 relays connected to window motors that are controling the arm movement. They are already inverse from eachother so i dont have to invert it on the code. What im having trouble with is im using the Y-axis on the joystick to control it, and when i push it forward, it works, but if i pull it back, it wont go back. i really need help with this. i keep looking over the code and it seems logical, i guess is some minor detail. I would Post a pictrue of the code but im not able to at the moment. This would help me so much if i could get an example. Team 3518 will greatly apreciate the service.
__________________
Team 3518
Jose G.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2011, 00:18
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: Programming 2 buttons for a relay

Quote:
Originally Posted by LatinDrummaBoy View Post
Hello, Im having some issues with something similar to this. I have 2 relays connected to window motors that are controling the arm movement. They are already inverse from eachother so i dont have to invert it on the code. What im having trouble with is im using the Y-axis on the joystick to control it, and when i push it forward, it works, but if i pull it back, it wont go back.
Are you trying to connect the joystick output directly to the relay input? That's not going to work. The joystick axis provides a value that ranges from -1 to +1. The relay wants a specific enumerated value. I could explain why neutral and forward work while back does not, but that wouldn't really help you. I've attached a picture showing how I would suggest doing it.

If you aren't trying to wire a joystick to a relay with nothing between them, never mind. I'll have to see your code to give any useful advice.
Attached Thumbnails
Click image for larger version

Name:	joy2relay.jpg
Views:	22
Size:	15.2 KB
ID:	10188  
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 16:35.

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