From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can LabVIEW be used to activate devices using relays?

Of course, no problem.
 
But first, get to know what your hardware is. then pick up a DAQ board to output DO (in most cases) signal to activate it.
 
LAbVIEW is only software like C++, VB, nothing special. You get to use output physical stuff (current, voltage) to activate relay.
0 Kudos
Message 11 of 15
(1,304 Views)

The cheapest way to control relays is to use the parallel port.  Search for examples on the parallel port in Labview.  If your relay draws too much current, you would have to build an interface to handle the current.  Or you could buy a DIO that handles higher currents.  Several high current DIOs are available.  Search the web.

Measurement Computing makes a DIO that plugs into the USB port, and it comes with Labview drivers.  It sells for about $100.  NI makes a DIO that plugs into a PCI slot, it is also very cheap.

Example using a 5V relay that draws less current than DIO max current out:  Wire one side of relay coil to ground.  Wire other side to one of the DIO lines configured for output.  Write Labview program to output TTL high on that line when you want to close the relay.  If you want to synchronize the starting of another vi when the relay closes, use a double pole relay.  Wire common contact on second pole to ground.  Wire normally open contact to a DIO line configured for input.  Write a Labview program that has a while loop.  Inside while loop, read the DIO input.  Should be high when relay is open.  When you get a low, the relay has closed, exit the loop.  After the loop, call the vi you want to start.  There will be a very slight delay between the relay closure and the vi start (microseconds), but that is the only way to start a vi from a relay closure.

If using a relay greater than 5v, or the relay draws higher current than the DIO or parallel port can handle, you can use a ULN2003 IC to interface between the relay and port.  Search web for ULN2003 to see specs and how it can work.  I normally use a ULN2003 along with an inverter, tie one end of relay coil to 5v/12v/24v (whatever is needed), tie other end to output of ULN2003.  Wire DIO output to inverter, and inverter output to ULN2003 input.  When DIO output goes high, relay turns on.  This helps keep the positive logic flow, hi means on, low means off.

- tbob

Inventor of the WORM Global
Message 12 of 15
(1,303 Views)

Hi tbob,

Very nice description.

Bonne Annee l' cousin!!  😄

 

Message 13 of 15
(1,301 Views)
Merci beacoup mon cousin eloigne, JLV.  Est Bonne Annee a vous aussi.
- tbob

Inventor of the WORM Global
0 Kudos
Message 14 of 15
(1,291 Views)
If you have the $, NI FieldPoint hardware is great.  Since FieldPoint connects to your LAN, your control computer can be far away.  In my case, I needed to be far away from the relays which controlled the dischare of high energy capacitor banks.
0 Kudos
Message 15 of 15
(1,270 Views)