LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching on/off dio96 individual lines discretely

I am in the processing of replacing a switch panel comprised of several spdt and dpdt switches.

Being rather new to LabVIEW, I am trying to figure out how to discretely control the individual relays on an ER-16 via a DIO96. I've reviewed several of the VIs available here and in the training materials that I received, but so far, they're all a little too complicated and a little too difficult to dissect for my needs. I just want to be able to drag and drop a toggle switch onto the VI and configure it to control, say, line 2, port 0 (on/off)... Then I'd like to be able to drag an drop another toggle switch and configure it to control line 3, port 0, etc.

I'll likely want to control 2 or more lines (relays) simultaneously with the DIO-96 since I'm using this solution to replace a swith panel with dpdt and spdt switches.

Anyone have some pointers to make this project simple?

Thanks in advance!
-darren
0 Kudos
Message 1 of 7
(2,817 Views)
See the attached example for a simple solution. Do not run the vi as is, choose one method or the other, then delete the unwanted one. Then you can run. Beware when using DIO to control relays. Most relays will draw more current than the DIO can produce. Also, the DIO puts out 5v, and relay coils may be of a different voltage, like 12 volts. Usually, the DIO is wired to drivers that can control the relays. These drivers can handle the relay coil currents and produce the correct coil voltage. A good driver to use is the ULN2003. You may have to invert the DIO lines using a 74LS04 (or is ot 06?) hex inverter to produce the correct results.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 7
(2,810 Views)
Thanks for the help, tbob. Following your suggestions, I removed the unneeded items in the vi. When I tried to run it, I got a 10613 error which indicated: NI-DAQ LV: The specified channel does not support the specified transfer direction or you have performed an operation on a digital port or line configured for the opposite direction. Did you see the same type of problem?

Cheers!
-darren
0 Kudos
Message 3 of 7
(2,794 Views)
i can't run my own vi because I don't have a DIO in my system. I was relying on past experience from a previous job when I wrote the example. Sounds like you just have to change the direction of the port. Bring up the DIO Config help screen. It will tell you what to wire as input to make the DIO outgoing or incoming. You should configure the port for outgoing or output. If the port is configured for input, then you can't use the DIO Write function, you will get the error that you have seen.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 7
(2,790 Views)
tbob,

Thanks a TON! This works and does precisely what I need it to do. It's starting to make a bit more sense at this point.

Forums like this offer invaluable help to newbies like myself thanks to the participation of individuals like you!!


Cheers!
-darren
0 Kudos
Message 5 of 7
(2,785 Views)
Any chance of getting a copy of DIO.vi saved in 7.0??

Thanks,

Dave
0 Kudos
Message 6 of 7
(2,779 Views)
Try this.
- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 7
(2,775 Views)