|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Re: Reversing Relay for motor
The Relay Set VI does not take values on the 1 to -1 scale. Look at the help for this VI to see which values correspond to which relay directions/values.
One way to do this is nested case structures. Another way to do this (and the way I will explain) is to use two Select VIs in series. The Select VI is found in the Comparison palette. The Select VI takes 3 inputs. The middle input determines which of the other two inputs is passed through. The top input is passed through if the middle is true. The bottom input is passed through if the middle is false. You want to make a Relay Set VI, right click on the Relay Value terminal and create a constant. Disconnect the constant from the terminal. Make a Select VI and wire the middle terminal to one of the buttons. Wire the top terminal to the constant and set the constant to the direction you want the relay to go when that button is pressed (Forward or Reverse). Copy the constant and wire it to the bottom terminal and set it to Off. Make a second Select VI and wire the middle terminal to the other button. the top terminal should be another copy of the constant set to the opposite direction. The bottom terminal should be the output of the first Select VI. The output of the second Select VI goes to the Relay Value terminal of the Relay Set VI |
|
#2
|
||||
|
||||
|
Re: Reversing Relay for motor
It makes sense...
I'll work it tomarrow. Thanks |
|
#3
|
||||
|
||||
|
Re: Reversing Relay for motor
This makes the most sense out of anything I've programmed to date, and a beutiful solution.
Thanks a whole bunch! ![]() |
|
#4
|
|||
|
|||
|
Re: Reversing Relay for motor
Hey we are a Rookie team and i was wonding how do you change the RelayValue input to blue... sorry dont know much about this program yet
![]() |
|
#5
|
||||
|
||||
|
Re: Reversing Relay for motor
Quote:
In case you were wondering, the blue thing that says "Off" or "Forward" or whatever is called an "enum." The data type is simply a number, but the datatype makes it so that when there's a control or constant it gives a word instead of a number. In this case, it's much easier for the user to select "forward" than to remember that forward is 2, so they used an enum. They're in the numeric pallet, and you add the text by right clicking on them and selecting "Edit" (you can also do that to see which name is which number). I assume that's what your talking about, because there are several different "blue things" ![]() |
|
#6
|
|||
|
|||
|
Re: Reversing Relay for motor
Ok thanks i will try that tonight...
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Programming 2 buttons for a relay | team877 | NI LabVIEW | 15 | 18-02-2011 00:18 |
| boolean selector for relay control | windell747 | NI LabVIEW | 6 | 15-02-2009 22:12 |
| Reversing motors | railerobotics | Programming | 5 | 16-01-2006 18:36 |
| Reversing controls? | Calvin | Programming | 10 | 14-03-2005 22:46 |
| Relay for Pump q? | MI28Driver | Technical Discussion | 2 | 31-01-2002 00:12 |