Serial IO RS-232/422/485

G

Guest

Hi,

Hopefully this is a pretty basic question. I need to perform serial IO using
VB.Net (VS2005/Framework 2.0) but the devices I communicate with can be
either RS-232 or 422/485. Is this a concern to me as the programmer, i.e.
does the UART or whatever handles the electrical side of things or do I need
to be aware of the type of connection being made a program accordingly. I
know I need to use System.IO.Ports.SerialPort but does this only support
RS-232. I can't find anything in the documentation that says if its RS-232
specific or not.
TIA - Peter
 
J

Jack Russell

Peter said:
Hi,

Hopefully this is a pretty basic question. I need to perform serial IO using
VB.Net (VS2005/Framework 2.0) but the devices I communicate with can be
either RS-232 or 422/485. Is this a concern to me as the programmer, i.e.
does the UART or whatever handles the electrical side of things or do I need
to be aware of the type of connection being made a program accordingly. I
know I need to use System.IO.Ports.SerialPort but does this only support
RS-232. I can't find anything in the documentation that says if its RS-232
specific or not.
TIA - Peter
You do not have to worry, in simple terms they are just different
electrical connections. Unless you have some special PC you will need an
RS232/485 converter but that is just some hardware.
 
G

Guest

Hi Jack,
You do not have to worry, in simple terms they are just different
electrical connections. Unless you have some special PC you will need an
RS232/485 converter but that is just some hardware.

Firstly, thank you for the very prompt response.

So, if I understand you correctly, if the device is not RS-232 I have to put
a hardware convertor on the line (before my serial port) that converts
RS-422/485 to RS-242.

Is this correct?

Cheers, Peter
 
D

Dick Grier

Hi,

The UART is simply hardware that sends and receives serial (asynchronous)
data. It knows nothing about the physical connection or requirements.

How you handle RS-485 depends on the protocol AND on the actual device in
use. However, RS-422 needs no special knowledge -- RS-422 is
point-to-point, balanced transmision, and from a software standpoint is
identical to RS-232. RS-485 (like RS-422 is balanced), on the other hand,
may support multipoint communications, either half or full-duplex. If you
are using RS-485 for multipoint communications, your software needs to be
tailored to the task.

If your RS-485 connection is only between your PC and a single device, then
your code may need nothing special, if you employ a 4-wire connection. If
you use a 2-wire connection, then there is more work to be done, even so.

BTW, I have additional information on this in my book (see below).

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
D

Dick Grier

Hi,
So, if I understand you correctly, if the device is not RS-232 I have to put
a hardware convertor on the line (before my serial port) that converts
RS-422/485 to RS-242.
<<

You need a RS-232 to RS-485 (or RS-422, which is similar, but not the same)
to convert voltage levels and to convert from single-ended (RS-232 on your
PC) to a balanced connection on your device if you use the serial port built
into the PC.

There are USB RS-422/RS-485 adapters that do not need to connect to a
physical serial port. Likewise, there are RS-422/485 boards that might be
used, too. A common scenario uses the PC serial port (RS-232) and an
adapter, but (easier) is something like:
http://www.usbgear.com/USB-COMi-M.html or
http://www.sealevel.com/product_detail.asp?product_id=516, which may be
configured to do what you want (there are lots of manufacturers of similar
hardware.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
J

Jack Russell

Peter said:
Hi Jack,




Firstly, thank you for the very prompt response.

So, if I understand you correctly, if the device is not RS-232 I have to put
a hardware convertor on the line (before my serial port) that converts
RS-422/485 to RS-242.

Is this correct?

Cheers, Peter
In general yes although there are some specialised motherboards which
actually have the converter built in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top