beautypg.com

Despatch Protocol Plus Modbus Communications User Manual

Page 44

background image

Chromalox Instruments and Controls

A-51643 Rev. 6 10/06/03

38

Without Parity Checking

Start

D0

D1

D2

D3

D4

D5

D6

D7

Stop

Stop

6.2.3

Error Checking Field

16-bit CRC

6.2.4

Message Framing

In RTU mode, messages start with a silent interval of at least 3.5 character times. This is most easily

implemented as multiple idle character times at the baud rate chosen for the network. The first field

transmitted is the device address. Following the last transmitted character, a similar interval of at least 3.5

character times marks the end of the message. A new message can begin after this interval.

The entire message frame must be transmitted as a continuous stream. If a silent interval of more than 1.5

character times occurs before completion of the frame, the receiving device flushes the incomplete

message and assumes that the next byte will be the address field of a new message. Similarly, if a new

message begins earlier than 3.5 character times following a previous message, the receiving device will

consider it a continuation of the previous message. This will set an error, as the value in the final CRC

field will not be valid for the combined messages. A typical message frame is shown below.

START

ADDRESS

FUNCTION

DATA

CRC CHECK

END

T1-T2-T3-T4

8 BITS

8 bits

n * 8 bits

16 bits

T1-T2-T3-T4

6.3 Address Field

Valid slave device addresses are in the range of 0-247 ($0-$F7). The individual slave devices are

assigned addresses in the range of 1-247. Address 0 is used for broadcast address, which all slave devices

recognize. No response is made to a broadcast message.

6.4 Function Field

Valid function codes are in the range of 1-127 ($1-$7F). When a message is sent from a master to a slave

device the function code field tells the slave what kind of action to perform. When the slave responds, it

uses the function code field to indicate either a normal (error-free) response or an exception response (an

error occurred). For normal response, the slave simply echoes the original function code. For an

exception response, the slave returns the original function code with the MSB set to logic 1.