LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port control

Solved!
Go to solution

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

0 Kudos
Message 1 of 15
(6,264 Views)
Solution
Accepted by Mazzo

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.

 

Message Edited by Ravens Fan on 09-10-2009 04:27 PM
Message 2 of 15
(6,253 Views)

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.

Message 3 of 15
(6,249 Views)

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

0 Kudos
Message 4 of 15
(6,222 Views)

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.

Message Edited by Ravens Fan on 09-11-2009 09:53 AM
0 Kudos
Message 5 of 15
(6,190 Views)

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.

Message Edited by Broken Arrow on 09-11-2009 10:29 AM
Richard






0 Kudos
Message 6 of 15
(6,176 Views)