09-10-2009 02:51 PM
hello
is it possible to control, using labview, the inputs and the outputs of a serial port as they were simple digital on/off channel?
for example in order to use them to turn on/off a relay or to read the state of a switch
I've searched among the labview examples but they show only complex communication to an hardware using strings...
thankyou in advance
paolo
Solved! Go to Solution.
09-10-2009 03:26 PM - edited 09-10-2009 03:27 PM
You can control the handshaking lines Request to Send (RTS) and DTE Ready (DTR). You can read the handshaking lines DCE Ready (DSR) and Clear to Send (CTS) as digital inputs.
They are accessed through property nodes of the VISA reference under Serial Settings / Modem Line settings.
Be careful of any loads you apply to them or signals you enter in terms of voltage and current so you don't fry your computer.
09-10-2009 03:30 PM
The voltages out of serial port are also highly variable.
If you are willing to risk your pc, you can try the parallel port which is 0-5V. That's assuming your pc even has a parallel port.
09-11-2009 02:57 AM
first of all thak you for your quick answers
now:
if insted of using a real serial port I use a usb->serial converter, is still true what you said?
in this case is the output stable at 5V (in the range of the usb)?
and furthermore, can I ask to this serial port the 0.5 A typical of an usb?
is the same for a usb->parallel converter?
paolo
09-11-2009 08:51 AM - edited 09-11-2009 08:53 AM
Using a USB converter MIGHT give you an extra level of isolation on the signal path, but that depends on how it is designed.
I really doubt you will be able to source 1/2 A from USB. That is the maximum amount of current the port could handle, and you often have to share that with other USB ports. And almost certainly a handshaking pin on serial, or a data pin on parallel is not going to be able to supply that much current.
You could use the pins to drive a transistor which switches on or off a larger voltage and current source. Search the forums and the web for schematics of how to do this.
Otherwise, I think you'd be better off getting an inexpensive digital input/output board such as the Measurement Computing brand.
09-11-2009 10:27 AM - edited 09-11-2009 10:29 AM
The USB -> Serial must have a charge pump circuit in it to get the serial levels correct, so you may have negative voltage on the line. Heed the warnings in the post. The parallel port idea is fairly safe and very easy, if you can go that route. There's enough drive there to light LED's, but I would not try a relay.
edit: and regarding what Bucs Fan said, I've bought digital I/O boards off eBay for < $50, some with a relay (and mosfet driver) already on it.