5872

Modbus Protocol Overview - RTU vs TCP vs ASCII

Modbus is a communications protocol for transmitting data between two or more devices. It was developed in 1979 for use with Programmable Logic Controllers (PLCs). It's now widely used for connecting many types of industrial electronic devices on different types of networks.


What is Modbus?

Modbus communication protocol is a widely used protocol in SCADA systems. It's used extensively for a number of its key benefits, including the following:

  • It's an open-source protocol. It can be included in a wide range of device types from any equipment vendor.
  • It uses a simple message structure, making it less difficult to deploy. It might require just a matter of days to implement, which can save months of work. There is no need to learn and deploy other protocols.
  • It moves raw words and bits, and it has very few restrictions.

Modbus Systems Are Flexible

Like any remote monitoring system, modbus follows the master/slave model. A system will consist of an RTU which polls a device for data and alarm information. A remote telemetry unit (RTU) will also be able to tell a modbus device when and what commands to execute.

Even the format of data is flexible. Devices store important values in various standard data units, called holding registers. A register could be one analog value, a collection of binary values, or something else. Manufacturers are free to use any number of formats (function code fields) to suit the function of their devices.

If your monitoring device needs information to present to a human operator, the targeted device will read holding registers to receive the data.


Two Channels: Modbus RTU vs TCP/IP

Modbus data can be carried on two channels - over serial communication, or over Ethernet. This flexibility is part of the lasting appeal of modbus.

There are two types of modbus serial protocols, RS-232 and RS-485. Modbus RS-232 allows concurrent, full-duplex flow of data. Modbus RS-485 is half-duplex, and indicates values using differences in voltage.

Modbus messages can also be sent over Ethernet or TCP/IP. These modbus messages are packed as a single bit, or 16-bit word packets.

Modbus is not part of a physical layer on a network, as with some other protocols. Messages are transferred on top of physical layers, enabling it to be utilized on many different types of networks. This non-physical layer property makes modbus an application layer SCADA protocol.


Real-World Example: Using Modbus to Track Your Generator Status

In this video, you'll see a few simple steps on how to monitor your generator using modbus. We'll start polling data from a backup generator (propane/diesel) using modbus. This example use the web interface of the NetGuardian DIN remote monitoring device.


Two Variants: Modbus ASCII vs RTU

There are two variants of the standard modbus protocol: Modbus RTU and Modbus ASCII. The modbus RTU protocol is more compact and uses binary communication. In this format, a message is always followed by a cyclic redundancy check checksum, which is used to detect transmission problems.

The second variant is the modbus ASCII protocol. This version is more verbose, and it uses ASCII characters that can be read by human operators. A different type of checksum, the longitudinal redundancy check checksum, takes place after ASCII data transmission. ASCII is the less secure of the two variants.

As it is also less efficient than the RTU variant, operators shouldn't use it as their go-to variant. Only utilize modbus ASCII for the transmission of data to devices that do not support the RTU format.


Modbus Is a Master/Slave Protocol

Modbus communications take place between a centralized master and up to 247 connected electronic devices on a single network. The design is commonly referred to as a "master/slave" protocol.

The system "master" requests information from connected modbus devices, which are referred to as "slaves." Slave devices only send information to the master in response to these requests and do not initiate messages. The master can also write information to the slave devices, but the slave devices cannot write information to the master.

When a slave address transmits a communication to the modbus master, it begins the message with a unique address identifier. This is a number ranging from 1 to 247. This enables the master to identify which specific device is responding with the requested information.


Modbus Holding Registers Store Key Values

Modbus registers are formatted according to one of several "function codes" based on the data contained. You might have an analog fuel level value stored as an 8-bit integer. Instead, a register could use those same 8 bits to store 8 different binary values (door open, power fail, etc.) in a bitmap.


Data Acquisition Can Take Several Forms

Just like any SCADA devices, the official modbus function of "data acquisition" can vary.

The most common thing you probably think of is an external sensor. You have a process that involves heat, so you put a temperature sensor near it. You have a sealed chamber, so you add a pressure sensor.

That's not the only way to acquire data, though. Many devices self-monitor and report via modbus; and generators are a great example. They monitor their own fuel levels, temperatures, pressures, and more.

Finally, there are synthesized registers that depend on soft values like timers and calculations. "Time since last maintenance" could be tracked as an analog value, perhaps. Some generators have over 1000 registers to poll. Most of them aren't a physical sensor reading.


Remember SCADA Best Practices - Regardless of Protocol

No matter what protocol you choose to use, keep in mind a few important points:

Always focus on open protocols that don't trap you in ridiculous licensing fees. By reading this article, you've already taken one step in the right direction.

Open standards empower you to choose a new manufacturer later. Closed protocols written by one manufacturer won't allow that.

Also, look for devices that speak in multiple protocols. You should always standardize as much as possible, because something WILL come up. Don't settle for a master if it only has modbus SCADA software if you have other devices that use different protocols like SNMP or DNP3. The T/Mon LNX is a great example of a master that speaks multiple protocols.


Invest Time in Evaluating Manufacturers

Any SCADA system you choose will have a big impact on your unmanned site. Your operations are important, and SCADA protects those operations. That's why you need to choose a manufacturer with a track-record. Big companies can be a reasonable option, but sometimes they're too big to care about you unless you're huge also, or willing to shell out tons of cash for a solution.

Proven providers who maintain a custom focus on your needs can be great. Look for a team that will provide free tech support, and who doesn't outsource their tech support.

Ask any sales rep you talk to whether designs can be changed or new features you need can be added. What if you need something unexpected, will they develop a solution for you? A great shorthand for this is whether a company has its own engineers. Devices built overseas and merely sold in your country can be a problem.

Ideally, your SCADA manufacturer has strong control over design, manufacturing, sales, and support. That's a priceless tool for the problems you can't predict.


Do Your Homework With These Guides

The more you know about modbus and SCADA, the more valuable you'll be to your company.


You can also read about the T/Mon Alarm Master if you're evaluating solutions now. Finally, keep learning about tech with the RS485/RS232 article below.

Related Products:

Related Topics:

Learn More

DPS is here to help.

1-800-693-0351

Have a specific question? Ask our team of expert engineers and get a specific answer!

Ask an Expert DPS Telecom Get a Fast Answer!

Click here for more information.

Get the SCADA White Paper

Download our free SCADA tutorial.

An introduction to SCADA from your own perspective.

SCADA White Paper Download White Paper

Click here for more information.

Having trouble finding the perfect solution?

Get Help

No other network on the planet is exactly like yours. We manufacture hundreds of product variations per year that are customized to our clients' exact spec, all while providing training, tech support, and upgrade availability.

Send us a quick online message about what you're trying to accomplish. We'll give you a call and work with you to design a perfect-fit solution for your network.

Hours: Monday - Friday
7:00 a.m. - 6:00 p.m. PST
Tech Support: (559) 454-1600 / support@dpstele.com
Sales: Domestic: (800) 693-0351
International: 1+ (559) 454-1600