Modbus Decoder: How to Decode Modbus Protocol

Olga Weis

The Modbus communication protocol is a means by which serial devices or applications can communicate through a network. It was developed in 1979 by the Modicon corporation for use in their programmable logic controllers.

Modbus employs a Master/Slave paradigm where the Master makes requests of the Slave devices which in turn provide responses to the Master. It is an open protocol and can be incorporated into any device royalty-free. This made it very popular with serial device manufacturers and it has become a standard communication protocol in the industrial and manufacturing sectors.

A standard Modbus network consists of a single Master and up to 247 Slave devices. In large production facilities, there may be several different Modbus networks in use to monitor and control various industrial processes. Industrial automation systems make heavy use of electronic monitors and controllers that employ the Modbus protocol.

There are two main transmission modes of Modbus. They are Modbus RTU (remote terminal unit) and Modbus ASCII. The RTU variation is more efficient whereas Modbus ASCII produces messages that are more readily understood by human readers.

Decoding these messages is the key to debugging issues with your Modbus network or the devices that are attached to it.

Serial Port Monitor is an innovative software Modbus protocol analyzer developed by Eltima Software that can be used to decode Modbus protocol messages in both the RTU and ASCII format.
Serial Port Monitor logo

Serial Port Monitor

Log and analyze serial port activity
4.8 Rank based on 41+ users, Reviews(75)
Download 14-day fully-functional trial period
Serial Port Monitor

The process of decoding converts the format that the serial devices use to communicate directly into meaningful messages to the human caretakers of the systems in question. Using a Modbus message decoder allows you to understand the messages moving through the Modbus network which can be instrumental in diagnosing problems and increasing efficiency.

When issues arise in a Modbus network implementation, the ability to decode the Modbus messages is imperative in addressing the situation in the correct manner. This is where a quality Modbus frame decoder like Serial Port Monitor can make the difference in allowing quick and precise identification of the problem that is impacting your network or devices.

Using Serial Port Monitor to Decode
Modbus Data

When you need to decode Modbus data, Serial Port Monitor is an indispensable tool that can aid developers or network administrators troubleshoot their networks. It is available as a free Modbus decoder download so you can see how the product can help in your Modbus installation. Here are instructions on how to decode Modbus messages using this excellent software tool.

  1. First, you need to start a new monitoring session by launching Serial Port Monitor.
  2. Select “Session -> New session” from the main menu. Alternately you can choose “New” on the main toolbar or use the CTRL+N keyboard shortcut. New session

  3. The “New monitoring session” screen will be displayed where you can choose the serial port or ports that you wish to monitor. New monitoring session

  4. Choose your desired visualizers from among Table, Line, Dump or Terminal View. If you are using the tool as a Modbus RTU decoder, select Modbus and RTU. Modbus ASCII is also available if that is the protocol you are using.
  5. New session options can be checked to “Start monitoring now” and to “Start in new window”.
  6. Select your Capture options to choose which events to capture – Create/Close, Read/Write or Device Control.
  7. Click on the “Start monitoring” button after you have made all of your selections. You will see the data in all of the formats you have chosen in the monitoring window.
Start monitoring

Modbus Analyzer enables you to further customize the way your monitored data is presented by modifying your session preferences. In order to access the configuration dialog, you select “Session -> Preferences” or use the shortcut CTRL+P. Here are the ways you can tailor the data view that your monitoring session displays.

monitoring session

  • Customize the way each visualizer is displayed by expanding the “Windows” option in the left window panel. You can choose to display your data in different colors and control which columns are displayed when you are in Table View. Table View

  • Customize the timestamp format to display the actual date and time or time intervals from the start of the session or since the last record was sent. This control makes it easier to see the records in a way the way that makes the most sense for your monitoring situation. timestamp format

  • The representation of transmitted data can be customized by modifying the string length and scale of notation. string length

  • The customizable send dialog lets you send text strings with or without their hexadecimal equivalents. You can also create aliases here to increase the transmission speed. send dialog create aliases
Understanding and Decoding the
Modbus Message Format

The Modbus protocol was designed to be used with serial devices and applications. At its most basic level, Modbus communication is binary and is conducted by sending a series of bits signifying zeroes and ones via voltages. A positive voltage indicates a zero and a negative voltage is a one. The binary data transmission is converted into hexadecimal with each block of 4 bits representing a Hex digit 0 through F.

Modbus protocol

Messages are the way that the Master and Slave devices in a Modbus network communicate with each other. Using a Modbus packet decoder lets us investigate these messages to understand what the devices are saying to each other and determine why network or interface problems are occurring.

The Modbus messages travel between Master and Slave and indicate the function or purpose of the request. Messages are returned to the Master from the Slave with the requested data or an indication that the function has been performed. Modbus messages are coded differently for the RTU and ASCII transmission modes of the protocol. This makes the two protocols incompatible with each other.

Modbus messages

Modbus messages are called frames and there are two types involved in communication. The Protocol Data Unit (PDU) which contains a function code and data is one of the frame types. The other is the Application Data Unit (ADU) which holds address and error-checking information. The function code indicates the action that is being requested to be performed with the data that accompanies the message.

Modbus devices contain coils which perform discrete on/off operations and registers which hold data. Function codes can request actions such as writing to a coil or reading or writing to a device’s registers.

Modbus RTU uses binary coding and a cyclic redundancy check (CRC) to perform error-checking. The ASCII Modbus transmission mode uses the less efficient longitudinal redundancy check (LRC) and ASCII coding so is more readable that is RTU. The use of binary coding means that data can be moved more quickly and efficiently and is the reason that the RTU transmission mode is used when possible. Modbus ASCII is useful when modems are involved due to the way the messages are delimited.

The ability to decode Modbus messages is vital when trying to track down communication issues in a Modbus network implementation. Using an application like Serial Port Monitor lets you see exactly what is going on between devices and swiftly take corrective action if needed. If you work with serial devices and the Modbus protocol, you really need to try the tool and see how it can help you and your organization.

Additional Features of Serial Port Monitor

This professional-grade Modbus protocol decoder is packed with many other features that make it a great tool for monitoring any type of serial communication. Here are some highlights from the software application’s extensive feature list:

  • All variations of COM ports are supported including physical and virtual ports as well as extension board ports and Bluetooth serial ports.
  • Monitor any number of serial ports simultaneously in a single monitoring session.
  • Any serial device or software application can be monitored.
  • Monitor ports that are already opened by another application.
  • Capture data in real-time and view it in multiple formats.
  • Monitoring sessions can be customized.
  • User-friendly interface that can be used with basic computer skills.
  • Export monitored sessions to a file in various formats such as HTML, ASCII, Unicode, and CSV.
  • All data can be easily copied to the clipboard.
  • Redirect exports to multiple files and control the maximum file size.
  • Stream filtering tools with convenient presets.
  • Monitoring sessions can be compared in the tool.
  • Resend data to a serial port to observe changes in its response.
  • Supports any device that employs the RS232/RS422/RS485 interface.

In addition to being a robust Modbus decoder, there are numerous other ways that Serial Port Monitor can be used when working with serial interfaces and devices. Here are some of them:

Modbus Analyzer runs on the Windows operating system and requires that you have at least one serial port on your system. It is a great addition to the software toolbox of anyone who needs to work with serial devices.

Serial Port Monitor

Requirements: Windows (32-bit and 64-bit): XP/2003/2008/Vista/7/8/10, Windows Server 2012, Windows Server 2016 , 9.16MB size
Version 7.0.342 (14th Jan, 2018) Release notes
Category: Serial Port Software