Modbus protocol: description, scope, advantages and disadvantages

Modbus is an open serial communication protocol. It was developed in 1979 for use with programmable logic controller (PLC) devices, and is now widely used to connect many types of industrial electronic devices connected to various types of networks.

The most widely used protocol in industrial automation (with the exception of local enterprises). Modbus is very popular. This is a fairly simple and intuitive device to use with standard serial communication. In a Modbus network, each device looks into the network as a set of coils (bits) and registers. The wizard reads and writes these coils and registers using a very simple and concise set of instructions. Communication moves only in one direction at a time.

The practical implementation of the Modbus protocol is very concise. Although there are twenty basic commands, only a few are really implemented. The most common commands are read coils, write coils, register reading, register setting. A small set of commands is another reason for the popularity of the protocol.

Modbus Advanced Protocol

The protocol converter is widely used for a number of reasons:

  • Modbus is an open source protocol. This means that it can be included in a wide range of device types from any equipment supplier.
  • Uses a simple message structure, which makes it less difficult to deploy. It may take only a few days to implement. This is a clear competitive advantage over other protocols that may take months to learn and deploy.
  • Supports serial or Ethernet connections.
  • Used with two types of serial connections: RS-232 and RS-485. Some versions of the Modbus tcp protocol can also be sent via Ethernet or TCP / IP. These Modbus messages are packaged as single-bit or 16-bit word packets.

Modbus network protocol is not part of the physical layer in the network. Communication is transmitted over physical layers, which allows it to be used in many different types of networks. This non-physical layer property makes Modbus an application protocol.

The Modbus data transfer protocol is a common way to collect data from different sources for viewing operations, archiving and troubleshooting from a central remote location. It is widely used and is a fairly simple technology. Depending on the application, a newer protocol may have more benefits.

Typically, a PC is configured to run programs such as Wonderware, Intellution, or LabVIEW in one place to collect data from different processes throughout the enterprise. Another application is designed to configure remote process controllers (PLC, Allen-Bradley, Siemens, PLCDirect and others). To respond to various levels or modes that are transmitted from the device.

Two protocol options

There are two protocol options that go through serial connections. One of them is the Modbus RTU protocol. Description of this option: it is more compact, uses binary communication. In this format, data transfer is always accompanied by a cyclic redundancy checksum, which is used to detect transmission problems.

The second option is Modbus ASCII. This version is more detailed, using hexadecimal encoding of ASCII data, which can be read by operators. Modbus ASCII is a less secure protocol. Since it is less efficient than Modbus RTU, operators should use ASCII only to transfer data to devices that do not support the RTU format. ASCII can also be useful if the RTU message cannot be applied correctly.

Modbus Protocol for Dummies

Modbus is a serial communication protocol used to transfer information over serial lines between electronic devices. The one that requests the information is called the master, and the information about the delivery of the devices is called the slaves. The standard Modbus network has one Master and up to 247 Slaves, each of which has a unique slave address from 1 to 247. The Master can also write information to Slaves.

What is it used for?

Modbus is an open protocol. This means that manufacturers can integrate it into their equipment for free. It has become the industry standard communication protocol, and is currently the most common means of connecting industrial electronic devices. It is widely used by many manufacturers in many industries.

Modbus is usually used to transfer signals from instrumentation and control devices back to the main controller or data acquisition system, for example, a system that measures temperature and humidity, transfers the results to a computer. Modbus is often used to connect a control computer with a remote terminal unit (RTU) in supervisory control and data acquisition (SCADA) systems. Modbus protocol versions exist for serial lines (RTU and ASCII) and for Ethernet (TCP).

How it works?

Modbus is transmitted on serial lines between devices. The simplest installation would be a single serial cable connecting the serial ports on two devices: Master and Slave.

Data is sent as a series of ones and zeros called bits. Each bit is transmitted as voltage, zeros are positive, and units are negative voltages. Bits are sent very quickly. A typical baud rate is 9600 baud (bits per second).

Master / Slave Protocol

When describing the Modbus RTU protocol, communication is carried out between the centralized master equipment, 247 connected electronic devices on the same network. The design is usually called the master / slave protocol, because the Master system requests information from connected devices called “slaves”. Slave devices send information only to the master in response to these requests; they do not work autonomously. The master can also record information to slaves, but slaves cannot record information to the master.

When the slave transmits a Modbus message, it begins to generate a message with a unique address identifier. This number is from 1 to 247, which allows the wizard to determine which specific device responds to the requested information.

Communication and devices

Each device used for communication using Modbus is assigned a unique address. In serial networks, only the node designated by the master can initiate a command. In Ethernet, any device can send a Modbus command, although usually only one master does it. The command contains the address of the device for which it is intended (from 1 to 247). All commands include checksum information to allow the receiver to detect transmission errors. The basic Modbus commands indicate to the RTU to change the value in one of its registers, control or read the I / O port, command the device to send back one or more values ​​contained in its registers.

There are many modems and gateways that support Modbus, as it is a very simple protocol and is often copied. Some of them were specially designed for him. Various implementations use wired, wireless communication, for example, in the ISM band, and even a short message service (SMS), as well as a general packet radio service (GPRS). Typical problems designers have to deal with include problems with high latency and time.

Overview of Modbus Register Types

Types of registers referenced by devices include:

• coil (discrete output); • discrete input; • input register; • holding registration.

Function codes

There are three categories of Modbus function codes:

  • Codes of common functions - from 1 to 127, with the exception of user codes verified by the Modbus community, are publicly documented and guaranteed to be unique.
  • Custom function codes - are in two ranges from 65 to 72, from 100 to 110.
  • Codes of reserved functions - used by some companies for outdated products, not available for general use.

Benefits

Some advantages of using the Modbus protocol:

  • If the driver is already installed, and the user is familiar with Ethernet and TCP / IP sockets, the driver can work and exchange data with the PC in a few hours. Development costs are considered low. Minimum equipment required. The driver is compatible with any operating system.
  • There is no need for “exotic” chipsets, so the system can use standard Ethernet PC cards to communicate with a recently implemented device. As Ethernet costs fall, hardware costs are reduced. Users are not tied to one service provider for support, but can take advantage of current developments.
  • The specification is available for free download, no additional licensing fees are required to use Modbus protocols.
  • Interaction between devices of different manufacturers and compatibility with an installed base of compatible devices.

Modbus protocol converters are expensive. The price of industrial gateways is $ 1,000.

Limitations

Since Modbus was developed in the late 1970s to communicate with programmable logic controllers, the number of data types is limited to those that were understood by the PLC at that time. Blobs are not supported.

There is no standard way for a node to find a description of a data object, for example, to determine if a register value represents a temperature value between 30 and 175 degrees.

Since Modbus is a master / slave type protocol, it is not possible for the device to "report an exception" (except for Ethernet TCP / IP, called open-mbus). The main node should regularly receive data from child devices, and also look for changes in the data. This loads the bandwidth, increases the network connection time in applications where bandwidth can be expensive, for example, in channels with a low data transfer rate.

Modbus is limited to addressing 254 devices on one data line, which limits the number of devices that can be connected to the master station (Ethernet TCP / IP is an exception). Transmissions must be continuous, which limits the types of remote communication devices to those that can buffer data in order to avoid transmission gaps. Modbus protocol itself does not provide protection against unauthorized commands or data interception. It is important to understand that in the process of transmitting information, logical errors occur, as well as distortions associated with the exchange.


All Articles