This blog explores how transferring data from Modbus to an MQTT broker enables advanced IIoT data use cases in manufacturing. It compares Modbus TCP and MQTT across key criteria like scalability, security, and network reliability, showing how combining both protocols bridges OT and IT systems. Methods include IIoT gateway hardware and software modules to convert Modbus TCP data for MQTT brokers like HiveMQ. Who is this blog for: IIoT Engineers, Manufacturing IT/OT Architects, and Industrial Automation Professionals.
Modbus is an open-source, royalty-free, de-facto standard for industrial communication protocols used widely by manufacturers to connect software and electronic devices.
Modicon (now Schneider Electric) originally published Modbus in 1979 to use with its programmable logic controllers (PLCs). It is still one of the most popular serial communication systems between PLC, Distributed Control Systems(DCS), controllers, sensors, actuators, field devices, and interfaces.
There are many variants of the Modbus protocol. Modbus TCP is a variant used for communications over Transport Control Protocol/Internet Protocol (TCP/IP) networks. The Modbus TCP Client-Server (Master-Slave) model caters to many applications. However, with the advent of concepts such as Industry 4.0, Industrial Internet of Things(IIoT), 3G/4G, and geographically distributed wireless devices, the use of Modbus TCP has been challenging. Manufacturers are finding that combining the power of Modbus’ open-source industrial communication with the power of MQTT, which is more suitable for IIoT use cases, is very powerful.
:format(webp))
MQTT is a standard binary publish-subscribe-based messaging protocol designed for fast and reliable data transport between devices and an enterprise, especially under very constrained conditions. Constrained conditions could be unreliable network connectivity, limited bandwidth and limited battery power, or similar. MQTT is built on top of TCP/IP and is ideal for IIoT use cases. It is used across applications, including manufacturing, to connect Operations Technology (OT) data to Information Technology(IT) data.
The following diagram represents an MQTT system’s components, including clients that could be publishers or subscribers and a central MQTT broker.
:format(webp))
Combining Modbus TCP with MQTT enables advanced data analytics use cases by ensuring the right data is available in a timely manner. Before we can talk about how the power of these two protocols can be combined, let’s explore some of the fundamental differences between them.
Modbus TCP Vs. MQTT
Modbus TCP is a point-to-point connection client server-based protocol that doesn’t need any intermediaries. This works well in on-premise machine-to-machine communication but doesn’t scale for machine-to-enterprise or cloud use cases. This is where MQTT excels.
As a publish-subscribe based protocol, MQTT manages connections between publishers and subscribers efficiently through a broker. This is ideal for enterprise data movement as it bridges data between OT and IT systems.
Here is a table summarizing which protocol is preferred based on the use case.
As illustrated in the above comparison, Modbus TCP is an ideal protocol for on-premise machine-to-machine or machine-to-application use cases. Contrarily, MQTT is ideal for on premise to enterprise or on premise to cloud data communication to support IIoT use cases. The combination of the two protocols can be a potent union as manufacturers have realized.
As seen from the MQTT architecture above, any MQTT client can send data to an MQTT broker. For a Modbus TCP data source to send data to an MQTT broker, that data must first be translated to MQTT and then passed through an MQTT client. There are multiple ways to achieve that.
The first method would be using a hardware device like an IIoT gateway. For example, the groov EPIC from Opto22 can support the ability to talk Modbus TCP protocol on the southbound, convert that to MQTT, and then send the data through an MQTT client to an MQTT broker.
:format(webp))
The second method uses IIoT software modules from vendors like N3uron, which can be loaded onto the customer’s servers. This method achieves the same outcome as using an IIoT gateway hardware.
:format(webp))
Choosing the IoT Protocol that Suits the Customer’s Needs
Both Modbus TCP and MQTT have advantages and disadvantages. Weighing these differences and the specific manufacturing deployment needs will help determine which one or combination to employ. In the instance where combining these makes sense, you bridge the data between the two systems to get the best of both worlds.
HiveMQ offers an enterprise-grade MQTT data broker that offers scalable, reliable, and secure bidirectional data movement for IIoT use cases, including manufacturing. As we talked about, there are several challenges to IIoT data collection and movement, especially when bridging data efficiently from OT systems to IT systems. MQTT Data brokers like HiveMQ play a vital role in ensuring that the data is collected and is available for advanced instances that allow organizations to fully benefit from Industry 4.0 and IIoT technologies.
Additional Reading
- Read the blog MQTT Vs. HTTP for IoT to learn the differences between MQTT and HTTP protocol or if you are contemplating using MQTT or HTTP for your use case.
- Read the blog MQTT Vs. AMQP for IoT to learn the differences between MQTT and AMQP protocol.
- Read the blog MQTT Vs. CoAP for IoT to learn the differences between MQTT and CoAP protocol.
- Read the blog Understanding the Differences between MQTT and WebSockets for IoT to explore how MQTT and WebSockets are not really in competition with each other, but complementary
