implementing modbus protocol via RS-485

U

Thread Starter

uri

are the 2 crc bytes at the end of a message
should be send as a frame (with start,stop and a
parity bit) ?
 
C

Cesar Gimenez

Greetings. That is correct!. Both the character check and message frame check are generated in the master device and applied to the message contents before transmission, then they are transmitted using the same framing (including start, stop and parity if is used). Be sure when the 16–bit CRC (two 8–bit bytes) is transmitted in the message, the low-order byte will be transmitted first, followed by the high-order byte. For example, if the CRC value is 1241 hex (0001 0010 0100 0001): you must send 41hex first and 12hex after. I hope to have answered your question.
 
During the 3.5 char silent interval.
in what state my transmit line should be ?
(1 or Z)

do you have some c/c++ examples of message
transmit.
 
H

Henrik W Maier

uri wrote:
> what is the silent interval prceeding and ending each message consist
> of?

Nobody drives any data on the RS485. All transmitting line drivers are passive.

> are the 2 crc bytes at the end of a message should be send as a frame
> (with start,stop and a parity bit) ?

The CRC bytes are the last two bytes sent within the message frame. They are no different to any other byte of the message in regards to framing which means you need start bit and the configured number of stop bits and configured parity bit.

Henrik W Maier
FOCUS Software Engineering

______________________________________

FOCUS Software Engineering
Brisbane, Australia
http://www.focus-sw.com
______________________________________
 
L

Lynn August Linse

On October 19, 2002, uri wrote:
> what is the silent interval prceeding and ending each message consist of? <

Async data is always (normally?) assumed to be a binary level '1' during idle times.

With a point-to-point link like RS-232, this is maintained by the driver chip.

With a multi-point link like RS-485, this likely needs to designed into the system by you (or the end users) using very weak pull-up/pull-down to hold the wires into a known binary 1 state when no transmitter is enabled.

Best Regards

Lynn August Linse, alist (at) linse (dot) org
IA Firmware Specialist, Digi Int'l (www.digi.com)
Board Member, The Modbus Organization (www.modbus.org)
26741 Portola Pkwy, Suite 1E #242
Foothill Ranch CA 92610-1743 USA
Ph/Fx: 949-916-1524 (voice message usually)
 
Top