Instruction Manual

9
Modbus Message Formatting
The MODBUS protocol describes an industrial communications and distributed control system developed
by Gould-Modicon to integrate PLC’s, computers, terminals, and other monitoring, sensing, and control
devices. MODBUS is a Master/Slave communications protocol, whereby one device, (the Master), controls
all serial activity by selectively polling one or more slave devices. The protocol provides for one master
device and up to 247 slave devices on a common line. Each device is assigned an address to distinguish it
from all other connected devices.
Only the master initiates a transaction. Transactions are either a query/response type, (only a single slave is
address), or a broadcast/no response type, (all slaves are addressed). A transaction comprises a single query
and single response frame or a single broadcast frame.
Certain characteristics of the MODBUS protocol are fixed, such as the frame format, frame sequences,
handling of communications errors and exception conditions, and the functions performed.
Other characteristics are user selectable. These include a choice of transmission media, baud rate, character
parity, number of stop bits, and the transmission modes, (RTU or ASCII). The user selected parameters are
set, (hardwired or programmed), at each station. These parameters cannot be changed while the system is
running.
Modes of Transmission
The mode of transmission is the structure of the individual units of information within a message, and the
numbering system used to transmit the data. Two modes of transmission are available for use in a
MODBUS system. Both modes provide the same capabilities for communicating with PLC slaves; the
mode is selected depending on the equipment used as a MODBUS Master. One mode must be used per
MODBUS system; mixing of modes is not allowed. The modes are ASCII (American Standard Code for
Information Interchange), and RTU, (Remote Terminal Unit.) The characteristics of the two transmission
modes are defined below:
Characteristic
ASCII (7-bit)
RTU (8-bit)
Coding System
hexadecimal (uses ASCII
printable characters (0-9, A-F)
8-bit binary
Number of bits per character:
start bits
1
1
data bits (least significant first)
7
8
parity (optional)
1
1
(1-bit sent for even or odd parity,
no bits for no parity)
(1-bit sent for even or odd parity,
no bits for no parity)
stop bits
1 or 2
1 or 2
Error Checking
LRC (Longitudinal Redundancy
Check)
CRC (Cyclical Redundancy
Check)
ASCII printable characters are easy to view when troubleshooting and this mode is suited to computer
masters programmed in a high level language, such as FORTRAN, as well as PLC masters. RTU is suited
to computer masters programmed in a machine language, as well as PLC masters.
In the RTU mode, data is sent in 8-bit binary characters. In the ASCII mode, each RTU character is first
divided into two 4-bit parts, (high order and low order), and then represented by the hexadecimal
equivalent. The ASCII characters representing the hexadecimal characters are used to construct the