Linux RS485 driver for a RS232/RS485 converter for a single RS485 bus device

A

Thread Starter

Andrew Minett

I'm trying (with little luck) to write a linux RS485 driver for a
RS232/RS485 converter and a single RS485 bus device. I'm not sure what is
happening but we cannot seem to get the RS485 bus to listen or talk.

Not sure if you or one of your contacts could help us.


The information supplied to us regarding the RS485 bus is as follows:

COMM Protocol
----------------------
The aim of the protocol is to provide an easily decipherable massaging
system which supports both SSCII and Binary Data Exchange between nodes in
the equipment.


Bus Communications
---------------------------
Communications between needs is implemented on a half duplex RS-485 serial
bus. One node is initially designated as master (typically the
Controller).
All other nodes are slave nodes and may only communicate in response to
messages addressed to them. Control may be passed from the master to any
slave by issuing an "Escape" Command back to the master.

Most messages will contain ASCII only and thus may be easily interpreted
on
a dumb terminal.


Message Format
----------------------
<DLE ; Data Link Escape Char = "!"
<RID ; Receiver ID = "A" - "Z"
<TID ; Sender ID = "A" - "Z"
<MSG ; Message Data
<EOM ; End of Message = Carriage Return = 13

<DLE in Message Data is replaced by <DLE<DLE
<EOM in Message Data is replaced by <DLE<EOM


Message Data
------------------
Message Data may be a command or a response to a command.


Command Codes are:

# - Number of Parameters
D - Decrement Parameter or set to Off
E - Escape, ie: pass control
I - Increment Parameter or set to On
S - Set Parameter
N - Name of Device
P - Name of Parameter
V - Value of Parameter

Sample C Code attached
 
- get a microprocessor based RS232 to 485 convertor. (www.rs485.com) and set your comm parameters to 8 bits, 1 stop bit, no parity, and no handshaking. The microprocessor will handle all the bus data turn-arounds and you can concentrate on the business end of the App. instead of the communications housekeeping.
 
Top