International Network Hardware User Manual

11-2 About Modbus
About Modbus
What Is Modbus
Modbus is a protocol that defines a method for devices in an industrial automation environment to
communicate. It allows a single controlling unit, called a protocol master, to manage one or more
units, called protocol slaves. The protocol specifies that only the master may initiate
communication. Slaves may only respond.
The protocol defines the structure of Modbus messages, determines how the master requests
information from the slave or specifies an action for the slave to take, defines how the slave is to
respond, specifies addressing conventions, and deals with many of the other details required for
communication to occur.
Modbus and Modbus TCP
There are two forms of the protocol. Modbus, the older of the two, was designed to run over serial
connections, such as RS-232 links, and designed to use one of two encoding schemes, ASCII or
RTU.
Modbus TCP is simply an adaptation of Modbus that provides for Modbus message encapsulation
within IP datagrams, enabling Modbus messages to run over TCP/IP networks.
Digi’s Support for Modbus and Modbus TCP
Digi provides an extremely flexible implementation, offering support for Modbus TCP, Modbus
with RTU encoding, and Modbus with ACSII encoding. The implementation allows any
combination of these transport mechanisms.
Here are some examples of the configurations supported:
A master (or multiple masters) using Modbus TCP communicates through the Digi device with a
port-attached slave or group of slaves using Modbus RTU. A similar configuration allows the
master to use Modbus TCP to communicate with a port-attached slave using Modbus ASCII.
A port-connected master using Modbus RTU communicates with multiple network-connected
slaves, each using Modbus TCP.
Configuration Methods
Modbus can be configured using the web interface or the command line. The web interface is
extremely easy to use and works for many configurations. More complex configurations may
require the flexibility provided by the command line interface.
Key Modbus Configuration Considerations
A key to ensuring that your Modbus configuration works as intended is matching masters with the
slaves they control. So, here are some things to keep in mind:
The default configuration allows any Modbus TCP master to communicate with any port-
attached slave using RTU encoding. Consequently, if there are no security considerations, that is,
if you are not concerned about restricting access to slaves to particular masters, and the slaves
use RTU encoding, no Modbus configuration is required. (There are still, however, some non-
Modbus configuration tasks that must be completed, such as assigning the Digi device an IP
address and configuring ports.)
If you use the command line, you must match masters to slaves in the following way:
The set modbus slave command has a range field that requires you to assign an index number
to identify the slave.
The set modbus master command has a slave field that requires you to list the index numbers
of slaves that are to be controlled by that master. The examples that follow will clarify this
relationship.