Beruflich Dokumente
Kultur Dokumente
MODBUS RTU Basics When the slave device performs the requested function, it
To communicate with a slave device, the master sends a sends a message back to the master. The returning
message containing: message contains the slave’s address and requested
function code (so the master knows who is responding),
• Device Address the data requested, and an Error Check value.
• Function Code
• Data MODBUS Memory Map
• Error Check Each MODBUS device has memory, where process
variable data is stored. The MODBUS specification
The Device Address is a number from 0 to 247. Messages dictates how data is retrieved and what type of data can
sent to address 0 (broadcast messages) can be accepted be retrieved. However, it does not place a limitation on
by all slaves, but numbers 1-247 are addresses of specific how and where the device vendor maps this data in its
devices. With the exception of broadcast messages, a memory map. Below would be a common example of
slave device always responds to a MODBUS message so how a vendor might logically map different types of
the master knows the message was received. process variable data.
Figure 2. Function Codes. Discrete inputs and coils are one-bit values, and each has
a specific address. Analog inputs (also called “Input
Command Function Code Registers”) are stored in 16-bit registers. By utilizing two
of these registers MODBUS can support the IEEE 32-bit
01 Read Coils
floating point format. Holding Registers are also 16-bit
02 Read Discrete Inputs internal registers that can support floating point.
03 Read Holding Registers
Figure 3. The literature or operation manuals of most MODBUS-
04 Read Input Registers
compatible devices, such as this TMZ Temperature Transmitter
05 Write Single Coil from Moore Industries, publish the addresses of key variables in
the MODBUS Memory Map. The TMZ’s addresses conform to the
06 Write Single Register MODBUS spec.
07 Read Exception Status Table
Type Table
08 Diagnostics Addresses Name
. 1-9999 Read or Write Coils
. 10001-19999 Read Only Discrete Inputs
xx Up to 255 function codes, depending 30001-39999 Read Only Input Registers
on the device
40001-49999 Read or Write Holding Registers
Figure 4. Home Run Wiring vs MODBUS. In most plants, field instruments connect to the control system with individual “home run”
twisted pairs (below). When the instruments are wired into a distributed I/O system, such as the NCS from Moore Industries (center),
more devices can be added, but only a single twisted pair is needed to transmit all the data to the MODBUS master. Multiple NCS systems
can be networked (bottom) over the same MODBUS network, so the entire plant can be converted from home run wiring to MODBUS.
Reading and writing digital inputs and outputs is done in In some cases, the control system is not able to deal
a similar manner using different read and write functions. with a MODBUS signal. It may be that the legacy control
system is accustomed to dealing with 4-20mA analog
Assuming that the device follows the MODBUS I/O and directly wired digital I/O, and reprogramming the
specification, it is a simple programming task to set up old system to accommodate MODBUS data would be
the master to read and write data, check status, obtain difficult. Often, users would like to add new remote
diagnostic information and perform various control and signals to their system without having to run wire or buy
monitoring functions. expensive MODBUS interface cards that require extensive
re-programming. In that case, a peer-to-peer solution
Connecting MODBUS Devices works best. For example, the CCS (Cable Concentrator
One of the easiest ways to bring field devices into a System) and the NCS (NET Concentrator System) from
process control system, PLC or industrial computer is to Moore Industries both have peer-to-peer communication
simply connect digital and analog I/O into a distributed abilities.
I/O system that has MODBUS communication capability.
For example, the NCS (NET Concentrator System) from The NCS and CCS are similar to a distributed I/O module,
Moore Industries allows a user to connect analog and but have more built-in intelligence and can be set up in
digital signals remotely, which can then be connected to either a peer-to-peer or peer-to-host configuration.
a MODBUS master via twisted pair cable. Multiple NCS
systems can be installed in several locations throughout With a peer-to-peer NCS system (Figure 5), two concen-
the plant, all linked by MODBUS (Figure 4). trators are used: one in the field and one in the control
room. Field instruments connect to the remote NCS,
This solution works for both new and existing plants. which connects to the control room NCS via a single
In many existing plants, field instruments typically twisted pair wire. Then, outputs from the control room
connect to the DCS or PLC via “home run wiring,” where NCS are wired into the control system’s existing analog
each device is connected with individual twisted pairs I/O panel. In this way, the analog signals from the new
that carry analog signals. With the NCS, one of those field transmitters can be seen in their original analog state
twisted pairs can be used for the MODBUS signal. This through the plant’s existing analog I/O cards. This makes
is particularly useful if the plant wants to add additional programming and commissioning of the new signals less
field instruments, but does not want to run more wiring difficult than programming new digital interface cards.
(at an installed cost of $100 per foot). A distributed I/O These peer-to-peer solutions can also accommodate
Figure 5. Peer-to-Peer Wiring. In some cases, the control system is not able to deal with a MODBUS signal. In that case, a peer-to-
peer solution with two NCS systems simply replaces all the home run wiring with a single MODBUS cable. Analog outputs from the control
room NCS are then wired directly into the host system’s I/O card.
Dispersed
Process 4-20mA
Transmitters
Module
MODBUS RTU
Number
RS485 4-20mA
Signals DCS
Communication Link
Proportional
to Transmitter
Inputs
MODBUS Distributed
many RS485 and RS422 protocols.
Field Devices
MODBUS RTU
RS485
HMI/SCADA
(MODBUS Master)