beautypg.com

Modbus ascii and rtu modes, Message framing, Modbus ascii and rtu modes 185 message framing 185 – Watlow CPC400 User Manual

Page 199

background image

CPC400 Series User’s Guide

Appendix A: Modbus Protocol

Doc. 0600-2900-2000

Watlow Anafaze

185

Modbus ASCII and RTU Modes

The Modbus protocol supports two distinct serial transmis-
sion modes: ASCII and RTU. The mode determines how
messages are framed and coded. Typically, ASCII is used
for simple communication tasks or diagnostics while RTU
is used where a more robust and efficient protocol is re-
quired. The CPC400 supports Modbus RTU mode only.

In ASCII mode, each character in a message string is com-
posed of a hexadecimal character which is correlated to an
ASCII character. For example, an ASCII message string
contains the value of a process variable, 5500 (550.0 de-
grees). 5500 in an ASCII string is composed of 4 bytes, 35
35 30 30. 35 and 30 in hexadecimal equate to the characters
“5” and “0” in the ASCII table respectively.

In RTU mode, the actual value is embedded in a message
string. There is no translation to ASCII characters. This re-
sults in more compact message strings and efficient serial
communications. The value 5500 in an RTU string is com-
posed of its hexadecimal equivalent which is only 2 bytes,
15 7C.

Many host devices can communicate in either ASCII or
RTU mode. However, it should be noted that some PLCs
can only be an ASCII host.

Message Framing

Messages start with a silent interval of at least 3.5 charac-
ter 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 Figure A.2). The first
field then transmitted is the device address.

Networked controllers monitor the network bus continu-
ously, 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 mes-
sage. A new message can begin after this interval.

Similarly, if a new message begins earlier than 3.5 charac-
ter times following a previous message, the receiving de-
vice 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. An example
message frame is shown in Figure A.2.