Error check field, Message framing, Handling the address field – Watlow CLS200, MLS300 and CAS200 User Manual

Page 29: Handling the function field

Advertising
background image

Chapter 2: Modbus-RTU Protocol

Communications Specification 23

8 data bits, least significant bit sent first

2 stop bits

No parity

Error Check Field

Cyclical Redundancy Check (CRC)

Message Framing

Messages start with a silent interval of at least 3.5 character times. This
is most easily implemented as a multiple of character times at the baud
rate that is being used on the network (shown as T1-T2-T3-T4 in the
figure below). The first field then transmitted is the device address.

The allowable characters transmitted for all fields are hexadecimal 0 to
9, A to F. Networked devices monitor the network bus continuously,
including during the silent intervals. When the first field (the address
field) is received, each device decodes it to find out if it is the addressed
device.

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.

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.

Handling the Address Field

The address field of a message frame contains 8 bits. Valid slave device
addresses are in the range of 0 to 247 decimal. The individual slave
devices are assigned addresses in the range of 1 to 247 decimal. A
master addresses a slave by placing the slave address in the address field
of the message. When the slave sends its response, it places its own
address in this address field of the response to let the master know which
slave is responding.

Handling the Function Field

The function code field of a message frame contains 8 bits. Valid codes
are in the range of 1 to 255 decimal. Not all these codes are applicable to
all controllers. Current codes are described in the Function Codes
section.

START

ADDRESS

FUNCTION

DATA

CRC CHECK

END

T1-T2-T3-T4

8 Bits

8 Bits

n

*

8 Bits

16 Bits

T1-T2-T3-T4

Advertising