AnyBus® Communicator Protocol Appendix - Modbus
DOC. ABC-APPENDIX-MB Rev.0.91
2001-08-01
4
HMS INDUSTRIAL NETWORKS AB
1 Appendix for Modbus
1.1 Introduction
When configured for Modbus protocols, the AnyBus Communicator supports Modbus RTU, Modbus ASCII and
Modbus Generic. Some basic knowledge is needed, as to understand how to use the Anybus-C for configuration of
the Modbus network.
The Modbus standard was created by Modicon for communication between controllers and other devices. The trans-
actions on the Modbus network are of master/slave type, and are named “query” and “response”. One single master
sends the queries. All transactions on the network have got a frame structure where one part is common for both
Modbus RTU and Modbus ASCII. This is illustrated in figure 1.
Figure 1: Modbus frame layout
The main difference between Modbus RTU and Modbus ASCII is that in RTU all hexadecimal values are represented
with one byte and in ASCII they are represented with two bytes. Another difference is the start and stop signs that
envelope the frame.
Modbus RTU
Each byte in the Modbus RTU message represents a hexadecimal value between 0 and 255. The frame looks exactly
like the one mentioned earlier and there is always an interval of 3.5 silent characters between the frames. CRC (Cycli-
cal Redundancy Check) is used for error checking. Multiple Modbus transactions would appear on the physical inter-
face like this:
Figure 2: Modbus RTU transactions
Modbus ASCII
Each byte in the Modbus ASCII message represents one hexadecimal digit i.e. 0-9, A-F. This means that two bytes
are used to represent each hexadecimal value (0x00-0xFF). For example, the value 0x2A is represented like this: 1st
byte: "2" (0x32), 2nd byte: "A" (0x41). Start and stop characters are added to the frame from Figure 1. A colon, ":", is
used as start character and "CR""LF" are used as stop characters. Longitudinal Redundancy Check (LRC) is used for
error checking. A complete Modbus ASCII transaction would appear on the physical interface like this:
Figure 3: Modbus ASCII transactions
Address
Function
Data
Error check
“:”
LRC
“CR” “LF”
silent transaction 1 silent transaction 2 silent transaction 3 silent
Start Address Function Data Error check Stop