Communicating over RS485 port - Help !!

  • Thread starter Thread starter Ewan Carr
  • Start date Start date
E

Ewan Carr

BlankHi,
Can someone help. I'm having huge trouble finding out a definitive answer on
this. I need to write an application (Windows 2000) to communicate over an
RS485 port and was proposing to use the Java Comm API. However as I
understand it is only supports RS232. After asking around

(i) Some people have told me that depending on the RS485 board the driver
may handle the RS485 issues "transparently" and that I can "speak" RS232 at
my application layer - Does anyone know for sure ?

(ii) Some indicate that I need to be aware of the RS485 difference at the
application level and so I cant use the Java Comm API as it stansds and
would write something myself

If anyone can shed any light on what the application programmer has to do if
anything when writing to a RS485 port that he doesnt have to do when writing
to an RS232 one that would be very useful

TIA
Ewan
 
The easiest way to send and receive data over a RS485 line from a PC
is to get a RS232 to RS485 converter and simply plug it into a RS232
serial port on your PC. You would then open up the RS232 port and send
and receive data as you normally would over a RS232 port connection.
The converter handles the conversion of voltage levels and RS485
handshaking signals .
A good place to get a RS232 to RS485 converter would be B&B
Electronics at www.bb-elec.com

You can also get a RS485 communications adapter and plug it into a
slot inside your PC however it is usually easier to get a converter.
If you use a RS485 adapter, it should work exactly the same as a RS232
adapter as far as the operating system is concerned. (It should look
and behave like any other RS232 COM port). You may need to install
special drivers for a RS485 adapter.

RS485 is a multi-drop protocol where the PC is usually configured as
the "Master" and all the devices on the RS485 line are "Slave"
devices. Each slave device has an address (0 to 31) and the master
initiates communications with a particular device by sending out the
address of the device that it wants to talk to. When an address is
sent out from the master, all slaves go to sleep except for the slave
that has the specified address and from then on all communications is
between the master and the specified slave device until the master
sends out a new address message.

Other than that RS485 communications is basically handled the same as
when communicating over a RS232 line.
Usually RS485 slave devices understand a fixed set of commands that
you would send to them to request data.

For more serial I/O information, tools and free software utilities,
please visit www.taltech.com
 
Back
Top