What is Modbus : Working & Its Applications

Modbus protocol is generally referred to as the grandfather of industrialized networking. In the current era of web services and internet communication protocols, communication and the request to respond to communication scenarios are practically picturesque. Modbus protocols are easily configured as per the industrial and business requirements. Because of this extreme popularity and widespread applications in multiple domains, this article provides a detailed overview of Modbus communication, its functional codes, implementations, and applications.


What is Modbus?

Modbus is the open standard RTU, where many organizations and engineers implement it into their device without including any kind of payments. This protocol is considered as the most ubiquitous communication protocol and generally accessible as a means of linking engineering electronic equipment.

In a detailed way, this is the communication protocol that is employed for information transmission between the electronic equipment through serial lines or through Ethernet connections. In an open standard condition, anyone can implement it. This is probably utilized for the connection of a system controlling using an RTU in SCADA in the power domain.

The protocol of Modbus is well-defined as a master and slave protocol which means that a tool functioning as master will make either one or more tools to have functioned as a slave. This clearly indicates that slave will not undertake data, it needs to wait until it was asked for the information. The master will write down information to the slave devices and then reads information from slave registers to the master. There will always exist a registered address from the perspective of slave registers.

How Does Modbus Communication Protocol Work?

As the Remote Terminal Unit (RTU) of this kind of open standard employs a master and slave approach to create communication across various devices, this corresponds that any kind of application that employs the RTU scenario will possess a Modbus master device and a minimum of one Slave device. This clearly indicates that slave will not undertake data, it needs to wait until it was asked for the information.

Modbus Communication
Modbus Communication

The master and slave communication across the devices is enabled either through serial buses or networks. In the OSI approach, Modbus is placed in the seventh layer. The purpose of this is to request the protocol and then delivers the corresponding services mentioned by functioned codes. These functional codes of Modbus RTU protocol are the Modbus request components.

So as to develop the Modbus application data unit, the delivery unit should instigate a device transaction. This is the operation which notifies the server to work on the specified kind of operation. The design of the request that is instigated by the master device is determined by the application protocol. Then the function code will be coded as 8-bits which is one byte. Only the function codes that are in the range of 1-25 are considered as valid and in this 128-255 are set aside for exceptional responses.

Architecture
Architecture

When there is a request/message from master to slave, this means that it is the function code field that notifies the server to perform the requested action. For some operations, there will be some sub-functional codes also. For example, the master device can read ON and OFF transitions of a cluster of various inputs/outputs.

It also either reads or writes the information of a group of Modbus registers. When the slave’s response is received by the master, then the function code field is utilized by the slave to signify either it is an unexceptional or exceptional response. The slave device will resonate for the request of the first function code in there is a normal response.

This is how the Modbus communication protocol has functioned.

Function Codes

The protocol of Modbus identifies multiple function codes to get accessibility for registers. There are mainly four various data blocks characterized by Modbus and here there might happen to the overlap of either register numbers or addresses. So because of this, an exact definition has to be defined where addresses are required and where functional codes are required.

The below table clearly summarizes the Modbus function codes. There exists only one subcategory of these codes. But for a few corresponding applications, these might not get applied.

Modbus Function Code Type of Register
1 Reading coil
2 Reading of discrete inputs
3 Reading of holding registers
4 Reading of input registers
5 Writing of single-coil
6 Writing of single holding register
15 Writing of multiple coils
16 Writing of multiple holding registers

Profibus v/s Modbus

To compare Profibus and Modbus as separate applications, each of the two have multiple benefits and applications.

Modbus has a simple construction, streamlined operation, and can easily approachable protocol. Though there exists some difference in the protocol by itself and in the definition of the physical layer, this develops issues in multi-vendor operations. Whereas Profibus is the most complicated protocol which was constructed to automate the whole industries. It operates exceptionally in the multi-vendor functionalities having modems and holds thorough diagnostics.

At the time of smart device connection with the controller in a point-to-point approach, or it there exists one remote location, then Modbus serves this scenario at the best. In the conditions when there exists more than one point which means multiple vendors, then Profibus serves at its best.

One application that gains more popularity provides the most excellent of both worlds. This application utilizes Modbus for the data transmission in between the master controller and a data concentrator and it has a remote location where this makes use of a Profibus.

Protocol Versions

Protocol versions in this device exist for both Ethernet and serial ports. The variants of Modbus protocols are:

Modbus RTU

To establish protocol communication, this represents data in a binary format and is mostly utilized in serial communication. The messages in this version are divided by idle periods. The format that is followed in the RTU version is a cyclic redundancy check to verify mechanism and this makes sure of data reliability.

Modbus ASCII

To establish protocol communication, ASCII characters are utilized and are mostly implemented in serial communication. The messages in this version are divided by a colon (“) and by trailing newline (/). The format that is followed in the ASCII version is a longitudinal redundancy check to verify the mechanism.

Modbus TCP

This version of Modbus is implemented for communications through TCP/IP networks linking over the port 502. This variant does not require any kind of checksum calculation as lower levels itself provides this.

Modbus TCP Architecture
Modbus TCP Architecture

Modbus Plus

This is the patented variant for Schneider Electric and in contrast to other kinds of variants, it supports peer to peer type of communications between various masters. It needs a committed co-processor to manage quick HDLC such as token variation. It makes use of a twisted pair at 1 Mbit/s and consists of transformer isolation placed at every node. A specific type of hardware is necessary to establish a connection between Modbus + and computers, such as the ISA bus.

The other kinds of protocol versions are:

  • Enron
  • Pemux
  • Modbus over UDP

Ethernet Vs Modbus

The difference between Ethernet Vs Modbus includes the following.

Ethernet

                               Modbus

Ethernet is used to connect different devices in a wired LAN (local area network) or WAN (wide area network). So, it allows devices to interact with each other through a protocol.

 

Modbus is one kind of communication protocol used to transmit data between electronic devices through the Ethernet or over serial lines. So it is usually used within process & factory automation.
Ethernet protocols are classified into different types basic, fast, gigabit, 10 gigabits, PoE(Power over Ethernet), and ATM (asynchronous transfer mode). Modbus protocols are classified into two types RS-232 & RS-485.
The advantages of Ethernet are efficiency, speed, security, quality data transfer, less cost, reliability, etc. The advantages of Modbus are;  simple installation, simple to use, reliable communication, open specifications, etc.

 

The disadvantages of Ethernet are mobility, installation, connections, expandability, etc. The disadvantages of Modbus are; It doesn’t have any object form however space is reserved only for addresses. Restricted to Ethernet, or / IP, OPC UA, ProfiNet IO and it have less data rate, etc.

 

Modbus Applications

The major applications are:

  • Used in the healthcare domain for analyzing automated temperature levels
  • Analysis of traffic behavior
  • Implemented in home automation for streamlined data transfer
  • Employed in industries such as Gas, Oil, Geothermal, Hydel, Wind, and Solar

In addition to these, the other major concepts also to be known in the concept are data visualization, register types, exception codes, communication with these gateway devices, data encoding in this type of RTU, data representation, troubleshooting, speed, and serial communication, and messaging. This article gives an overall description of what is a Modbus, its working, function codes, protocol versions, and applications.

The question that arises that has to be crucially known along with all these is what are the implementations of Modbus?