Modbus Serial Communication
Modbus Serial Communication
When working with digital panel meters and controllers, a lot of engineers have asked us for…
This article will discuss what Modbus communications is, some popular ways to use it, and explain some
of the terms often associated with using it.
Page 1 www.predig.com
These devices are capable of measuring multiple all levels of data acquisition devices directly; and
process variables. One common application is simplified device programming possible with
tanks with oil and water. The transmitter can computer software which is a part of most
sense the top level, interface level of the two Modbus devices.
liquids, and the average temperature in the tank.
The most accurate and most convenient way to The Basics of Using Modbus Devices
read this information is with a serial If you are interested in using a Modbus network
communications option, such as a Modbus. A for your next application, there are some key
Modbus scanner can display one or more of these terms and concepts that are good to know. The
variables with just a few serial communication following is a short summary of these terms.
wires. Precision Digital’s PD865 Snooper, for
example, can poll (request information from) up Network Types: RS‐485, RS‐232, or USB, etc.
to eight process variables, displaying one and
All of these are network types that can be used
allowing additional PD865 meters to display the
with Modbus. As stated earlier, Modbus is an
other variables. (www.predig.com/PD865) This
application‐layer protocol. This means it can be
would require three wires for RS‐485, wired in
used over a variety of physical‐layer networks,
parallel to three PD865 Snoopers. In contrast,
including RS‐485, RS‐232, USB, and more.
using traditional analog outputs and digital panel
meters would require three isolated 4‐20 mA All Modbus devices on a network need to have
signal loops with three isolated power supplies. the ability to connect to each other. To do this,
they must have the same communications
The reading of a digital value is also more
method (ie: RS‐485), or the system must include
accurate, as there is no analog signal inaccuracy
serial communications adapters to connect the
or temperature drift in a Modbus system. The
different networks. For example, RS‐485 to RS‐
reading on the display is exactly what the
232 adapters are very common and inexpensive,
transmitter is detecting.
and allow a RS‐485 network of Modbus
This enhanced accuracy also benefits flow rate transmitters to connect to the RS‐232 connection
and total systems. From industrial batching to common on most desktop computers.
custody transfer, accurate flow rates and totals
Each type of network has its own advantage.
are critical in oil and gas transport. Every analog
signal used in a system adds to the system
inaccuracy. Several very accurate meters,
transmitters, and displays can combine their error
to make a measureable inaccuracy in the system
as a whole. The more parts of this system that use
exact flow and total values transmitted by serial
communications, the more accurate the system
as a whole.
These two applications; mixed oil and water tank
gauging and precise oil and gas flow
measurement, are just two general examples of Example of Half‐Duplex (3‐wire) RS‐485 Wiring
how almost any system can benefit from the use
of Modbus serial communications. Other RS‐485: This is a full (5‐wire) or half‐
advantages include the simplicity of adding more duplex (3‐wire) network. The network is
devices into the Modbus network vs. a traditional multi‐drop, meaning it can have a large
network of analog signals; the ability of a number of devices wired in parallel on the
centralized SCADA system to communicate with same network. It can function over long
Page 2 www.predig.com
distances, of up to 4,000 ft (1219 m). This Type B, mini, and micro USB. USB device
communications method is common on cables are very short, less than 16 feet 5
industrial devices. Most personal inches (5 meters). While this can be
computers do not have an RS‐485 extended, the range is still short
connection, so a USB or RS‐232 converter compared to RS‐232 and RS‐485. Because
is needed to connect to an RS‐485 of this, most devices in an industrial plant
network to them. will be connected to a RS‐485 or RS‐232
network on the plant floor, and then use
a USB converter where the USB enabled
device or personal computer is located.
Ethernet: This network type is standard
Ethernet protocol; the same used on an
office internal computer network. The
advantage of this protocol is that the
devices can be accessed from anywhere
on the network, which is often installed
throughout a facility. With a web server
Example of a Common RS‐232 Connector device, the device can be accessed from
anywhere with an internet connection
RS‐232: This is most commonly available and proper network security credentials.
as the 9‐pin serial port common on older These can be more complicated to setup,
desktop computers. This communication and are often not necessary for gauging
method is still used when a single and process control applications. Ethernet
Modbus device needs to connect to an and web server adapters/converters are
older piece of hardware that does not available to connect the other network
have a USB connection, or when wiring types to an Ethernet network. This allows
distances of up to 1,000 ft (305 m) are other network types to connect to
required. Ethernet by configuring just one Ethernet
device, rather than every device in the
network. For complex devices that need
to each be available remotely via Ethernet
or the internet, having onboard Ethernet
or web server capabilities saves on wiring
and setup time, as well as and
configuration complexity.
Common Communications Settings
Other common specifications for Modbus devices
Example of Common USB Cables have to do with the serial communication
protocol parameters. These are common
USB: The Universal Serial Bus (USB), USB parameters that often need to be set by a user.
2, and USB 3 are very common
communication methods common on Device Address/Slave ID: Usually
modern devices and personal computers. programmable for 1 – 247 devices, each
USB is a simple and easy way to connect a device on the Modbus network requires a
Modbus network or device to a personal unique address. This allows devices on
computer. A number of standardized USB the network to know what data packets
connector sizes exist, such as Type A,
Page 3 www.predig.com
are relevant to them, and which are scanner will be programmed with the transmitter
meant for other devices. Modbus address/Slave ID as well as the register
Baud Rate: This is the communications number and data types for each piece of
speed in bits per second (bps). This must information to be read from the transmitter (ie:
be identical for all devices on the top level, interface level, and temperature).
network. This is usually in the range of
300 ‐ 19,200 bps. While often confusing to read through on their
Data Format: ( 8 bit (1 start bit, 1 or 2 own, these Modbus tables are a tool for
stop bits, etc.) The number of start bits, programming the Modbus master device (the
stop bits, etc. is used to configure the scanner in the above example). They are not
Modbus data packet. This should match intended as an instruction manual or application
on all devices on the network. guide, and are only used when referencing the
Parity: (Even, odd, or none with 1 or 2 data a Modbus master will read from a Modbus
stop bits) Like the data format, this slave device. Don’t be intimidated by the
relates to the Modbus data pack complexity of a Modbus table!
configuration. It should match on all
Don’t Be Intimidated
devices on the network.
To someone unfamiliar with Modbus and serial
Many other possible serial communications communications, the terms and tables can be
parameters may be set by a user in a Modbus overwhelming. It is important to remember that
device. Byte‐to‐byte timeouts, transmit delays, modern Modbus industrial devices are easier to
and other settings are often available, but the setup than ever, and are designed to be used by
default settings are often sufficient for simple instrumentation technicians, not just computer
networks. Networks that are slow, have many programmers and electrical engineers.
network adapters, or are particularly complex
may require these parameters to be set for non‐ Given the many advantages to Modbus devices
default values. and networks, it is worth it consider installing
them into future applications.
Modbus Registers and Tables
For more information about Modbus displays and
Defined for all Modbus enabled devices, Modbus scanners, or any flow, temperature, or pressure
tables are charts used to define the Modbus process meter application, contact:
registers used in a device. Each piece of
information accessible by Modbus in a device has Precision Digital
a Modbus register. Each register will have a data Voice: 800‐343‐1001
type and register number. For example, a E‐Mail: [email protected]
Precision Digital PD6000 digital panel meter [email protected]
stores the process variable in registers 40001‐ Web: www.predig.com
40002 as a floating point variable. The Modbus
register table for the PD6000 defines this, and
gives useful information ‐ this is a read only
register, and the table defines the allowable
range of values in the register.4
When configuring a Modbus network, the
information in these tables is entered into the
various devices that read information. For
example, if using a Modbus scanner to read the
values from a multivariable level transmitter, the
Page 4 www.predig.com
Author:
Joe Ryan
Product Engineer
Precision Digital Corporation
Sources:
1. “Modbus Technical Resources.” The
Modbus Organization. Web. 3 May 2013.
http://modbus.org/specs.php
2. “Modbus Application Protocol
Specification V1.1b3.” The Modbus
Organization. 26 April 2012. Pag 4. Web. 3
May 2013. PDF.
http://modbus.org/docs/Modbus_Applica
tion_Protocol_V1_1b3.pdf
3. "Universal Serial Bus" Wikipedia: The Free
Encyclopedia. Wikimedia Foundation, Inc.
7 May 2013. Web. 7 May 2013.
http://en.wikipedia.org/wiki/Universal_Se
rial_Bus
4. “ProVu® Series Modbus® Register Tables”
Precision Digital Corporation. Web. 7 May
2013.
http://www.predig.com/PD6000/#Docum
entation
Modbus® is a Registered Trademark of
Schneider Automation Inc.
Page 5 www.predig.com