|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Programming 2 buttons for a relay
But how do i set it between, forward, off, and reverse, or will it do that automatically
|
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||
|
|||
|
Re: Programming 2 buttons for a relay
Hey i am also trying to do the same thing. I think that there is a bug in labview. I Opened up two joysticks and wired 2 buttons to their own select function. On the first select function, the true statement was forward and the false statement was 0, i wried that to the false statement of the second select function. On the second select function's true statement was reverse. It was wired to a relay set and wen i ran the program both of the leds light up when i push the button but the relay will only go in one direction. I did the same code for a motor and it worked just fine so i think that the relay vi. has a bug in it
|
|
#4
|
||||
|
||||
|
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) |
|
#5
|
|||
|
|||
|
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! |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||||
|
|||||
|
Re: Programming 2 buttons for a relay
Quote:
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |