LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Relay Board

I am using the PXI-1033 the cards are the 2*6511 and the 6513 the cards go out to terminal blocks for the corresponding Card. 

 

 

Ok I know this code is very sloppy but that is why I am here I am wondering if there is a more efficent way to code this application what this application does is takes a driver and a readback and changes a relay this code does work but I feel it is very inefficient.

 

example:

 

relay 1 is charged by drive: (port.bit)0.0(6513 terminal block) and the readback is (port.bit)0.0(6511 terminal block).

and so on and so forth up to 100 relays.

 

also,  I need to use the PXI to compare readbacks with voltage or Return we tried to wire voltage to a readback and the PXI about blew up.

 

also, in some cases I need multiple readbacks to one drive.

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 1 of 8
(2,092 Views)

1.5 MB for a relatively simple VI.  That is because of all those DAQ assistants.

 

I'm curious about your statement "PXI about blew up".  Electrically?  I'm not sure what you are trying to do with voltage there.

 

Some of your code is happening in series  (numerous frames of a flat sequence structure), some in parallel (several flat sequence structures).

 

I don't know what you are trying to determine with your inner for loops.  They take in an array of booleans and autoindex through them.  The determine pass or failed and pass it out to a string indicator.  However, because it is an ordinary tunnel, only the very last boolean determines what the string says.  (Note instead of a case structure, the Select function on the Comparison palette would simplify the code a bit. 

 

All of those For loops could be placed in a subVI since all they do is take a Boolean array and pass out a string.  They are all identical.

 

In reality, with the proper use of DAQmx functions instead of all those DAQ assistants, it looks like every frame could actually be a subVI and you have a master For loop that operates on each DAQmx channel and puts the value into the string.  They would be an array of channels and an array of references to the strings.  That would get the code into a postage stamp.

0 Kudos
Message 2 of 8
(2,085 Views)

lol pretty much the back of the PXI had a large spark come out the back.

 

also yes I figured the select would help so I did that already I have a program that uses the DAQmx functions, but the person who wrote it has not explained it enough for me to use and it is very had to understand.

 

and yes those DAQ Assistanc are freakin huge.

 

also I was hoping there where some examples of using the DAQmx functions that maybe I could use.

Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 3 of 8
(2,079 Views)

Harold Timmis wrote:

also,  I need to use the PXI to compare readbacks with voltage or Return we tried to wire voltage to a readback and the PXI about blew up.


 


lol pretty much the back of the PXI had a large spark come out the back.

I also don't understand what you're trying to do with the voltage there. The fact that you got sparks is likely due to a huge voltage differential. You mentioned "relay 1 is charged by drive". I don't know what you mean by this. Have you got any large caps in the circuit?


 


also I was hoping there where some examples of using the DAQmx functions that maybe I could use.
There are lots of examples that ship with LabVIEW. Just open the Example Finder (Help -> Find Examples).

 

 

0 Kudos
Message 4 of 8
(2,070 Views)

I'm still not sure how you would try to read a voltage using digital input and/or output cards.  Before wiring one thing to another, verify what the voltage levels are between them.  Verify the voltage levels between grounds or common to be sure you don't have one device floating at a much higher voltage potential than the other.  Digital outputs can only source a small amount of current,  Digital inputs can only sink a small amount of current.  Be sure you are not connecting them in a way that causes too much current to flow throught the device.  You may need to use some resistors to limit the flow, or use bias resistors.  All I can say is carefully reat the manuals for both digital inputs and outputs and make sure you understand where to connect the wires, Voltage supplies, grounds, commons.

 

There are lots of DAQmx examples in the example finder.  Also, right click on one of your DAQ assistants and select Open Front Panel.  Then you can drill into the subVI's and see the DAQmx code that is operating behind the scenes of the DAQ assistant.

 

Also, if you are using digital outputs to drive relay coils, use some suppression such as a flyback diode across the relay coil.  This will protect against an inrush of current going through the digital output when the relay coil causes a voltage spike when it deenergizes.

Message Edited by Ravens Fan on 05-20-2009 05:51 PM
0 Kudos
Message 5 of 8
(2,069 Views)
it would be a continuity check that is all
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 6 of 8
(2,053 Views)
does anyone have any suggestions?
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
Message 7 of 8
(2,040 Views)

The PXI-6513 spec sheet says it can handle 125mA per channel when all channels are being used.  Make sure your relays do not draw more than this.  If they do, you will have to build a driver PCB to drive more current.  The ULN2003 or ULN2004 is a good relay driver that can handle 500mA and can be used to drive 12v or 24v relays with a TTL input.

 

You are wanting check continuity.  Continuity of what?  Are you saying that you want to insure that the relays are closing or opening?  You would need an analog input for that.  However here is a workaround.  Use double pole relays.  On the second set of contacts, wire the common contact to a 5v supply through 10K resistor.  Also wire this contact to one of your digital inputs.  Wire the normally open contact to ground.  When the relay is open, your digital input will read a high.  When the relay is closed, the digital input will read a low.

 

I hope this is what you are looking for.

 

tbob

- tbob

Inventor of the WORM Global
0 Kudos
Message 8 of 8
(1,975 Views)