Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Reversing Relay for motor (http://www.chiefdelphi.com/forums/showthread.php?t=82826)

kws4000 16-02-2010 17:10

Reversing Relay for motor
 
reversing a relay is my next big issue; those solenoids was more of a "protect my own hide"

1. button pressed, motor spins "1". button released, motor stops
2. another button pressed, motor spins "-1". button released, motor stops

any ideas? I would somehow have to get a "negative true" to the relay in order to reverse it.

I looked at the included example, it didn't make any sense at all. :confused:

kws4000 16-02-2010 18:08

Re: Reversing Relay for motor
 
1 Attachment(s)
Here is what I think might work in response to my own question. The buttons give TorF values, which in turn produce 1, -1, or 0. T produces 1 or -1, respectively, and F gives 0 on both. They are then added, so that
TF gives 1,
TT gives 0,
FT gives -1, and
FF gives 0,
which then go to the reversing relay. Can someone please advise whether this would work?

Thanks

Vikesrock 16-02-2010 18:16

Re: Reversing Relay for motor
 
1 Attachment(s)
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

kws4000 16-02-2010 18:44

Re: Reversing Relay for motor
 
It makes sense...

I'll work it tomarrow.

Thanks

kws4000 17-02-2010 15:21

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! :)

TEAM-3871 16-02-2011 00:07

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

::rtm::

WizenedEE 16-02-2011 00:32

Re: Reversing Relay for motor
 
Quote:

Originally Posted by TEAM-3871 (Post 1024064)
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

::rtm::

It's pretty simple, for every input and output to a function, if you hover your mouse over the wiring port to get the wiring mouse icon, right click, then go to create -> Constant, it will make a constant of the right type (you can do the same with controls and indicators). It's much faster than going into the number pallet or whatever.

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" :p

TEAM-3871 16-02-2011 09:38

Re: Reversing Relay for motor
 
Ok thanks i will try that tonight...:D


All times are GMT -5. The time now is 11:06.

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