MQTT Sparkplug for IIoT Solutions with PLC

MQTT Sparkplug for IIoT Solutions with PLC

MQTT Sparkplug is an interoperability protocol for use in industrial automation and smart manufacturing applications. Designed as a way to enhance the functioning of the standard MQTT protocol, Sparkplug ensures seamless communication between devices and systems by defining a standard payload and topic structure. Its implementation in the IIoT environment has revolutionized data exchange and system integration, increasing efficiency and enabling more robust and scalable automation solutions.

In this article, we will explore the features of MQTT Sparkplug B and how it provides a consistent way for equipment manufacturers and system developers to share contextual data, accelerating the digital transformation of industrial operations.

MQTT Sparkplug gaining ground in the industry

The Industrial Internet of Things (IIoT) and Industry 4.0 are important and definitive concepts in the manufacturing industry, concepts involving innovative technologies capable of delivering gains in operational efficiency, on-demand production, and real-time insights. However, the technologies used until now for software and hardware integration have always been closed and proprietary, and interoperability was never a major concern.

Protocols like OPC UA promised to provide a common language between devices, machines, and applications. However, the complexity of OPC UA does not allow it to perform satisfactorily in lighter operations that demand agility, high interoperability, and integration between different software and hardware agents.

The emergence of the MQTT protocol partially solved this problem, allowing for minimal latency and maximum throughput in cloud communication applications. Many developers desired a solution as simple as MQTT for manufacturing, but with the necessary features, such as payload definitions and unified message behavior across machines and vendors.

These expectations were met with the Sparkplug protocol, an MQTT-based standard.

What is Sparkplug and how has it been shaping the industry?

Sparkplug is an open-source software specification that provides MQTT protocol users with the necessary structure to integrate data from applications, sensors, devices, and gateways in a bidirectional and interoperable manner.

Sparkplug is designed to work 100% with MQTT through its publish/subscribe pattern, which allows for the bidirectional and decoupled integration of all components within a system.

When MQTT was invented in 1999, it was originally designed for SCADA systems, but it did not specify how topics and payloads should be structured or how devices should behave. This allowed MQTT to be used across different industries, such as connected cars and smart manufacturing.

Now, Sparkplug fills this gap and provides a vendor-neutral specification for data formats, topic structures, state management, and how topologies should be structured in IIoT scenarios.

The differences between MQTT and MQTT Sparkplug

When using basic MQTT communication, it is necessary to ensure that all participants interested in the data know where to subscribe to receive it. It is also necessary to ensure that all participants can interpret the data, which usually involves data transformations, requiring conventions and creating a tight coupling between applications.

With Sparkplug, all participants agree to use a common data format: how to receive specific data, how to publish their data, and how this data can be interpreted. Best of all, Sparkplug allows for the integration of data from non-MQTT devices as well as other protocols, such as OPC UA or MODBUS.

Benefits of using a Sparkplug architecture

A typical Industrial Internet of Things architecture connects components using a poll/response approach. Applications pull data directly from PLCs, gateways, or servers using protocols such as MODBUS, PROFINET, or OPC UA. While this works well when there are few systems to integrate, in architectures with a larger number of components, this management becomes complex and difficult to maintain.

Point-to-point interconnected systems create a fixed link between systems and their data. Modern architectures demand flexibility and a clear separation between components in an IIoT system. Many companies are seeking a new architecture that combines the adaptability and flexibility of IT landscapes with the reliability, security, and predictability of OT landscapes.

This new IIoT architecture offers benefits over traditional architectures:

  • Independence between data producers and consumers;

  • Report by Exception (RBE), which saves bandwidth, memory, and computational power for both the data producer and consumer;

  • One-to-many communication, where data only needs to be sent once and multiple receivers can receive it;

  • – Flexibility to add and remove devices and applications at any time without affecting the system;

  • Data governance through centralized permissions and policy management;

  • Direct cloud connectivity by distributing data from the cloud to the edge.

Many industries already use MQTT to create IIoT applications in distributed architectures, but with limitations due to the definition of topic structure, state management, and payload definitions. Sparkplug fills these gaps in MQTT.

Principles and mechanisms of MQTT Sparkplug

  • – Publish/Subscribe: Uses MQTT as a publish/subscribe architecture for the application transport layer, decoupling data producers and consumers. MQTT is based on push communication, meaning data is instantly distributed to all interested parties.

  • Report by Exception: Device data and state are updated only when there is a change, saving bandwidth and computational power for all components.

  • Continuous Session Tracking: Sparkplug and MQTT feature the concept of continuous session tracking, informing all clients about the online/offline state of devices in real time.

  • Death and Birth Certificates: Sparkplug introduces Birth and Death Certificates for device state management.

  • Persistent Connections: All devices, gateways, and applications are always connected using persistent TCP connections.

  • Automatic Discovery: Applications and devices can automatically discover which data and topics are being sent.

  • Standardized Payload Definition: The Sparkplug data format for all messages is standardized and can be encoded and decoded by all participants.

  • Standardized Topic Namespace: All Sparkplug participants use a common topic namespace, allowing for detailed subscriptions and the dynamic addition and removal of participants.

Components of an MQTT Sparkplug Architecture

A traditional Sparkplug architecture consists of the following components:

  • SCADA/IIoT Host: The SCADA/IIoT Host is the supervisory application responsible for monitoring and controlling the MQTT EoN nodes and their respective devices and sensors. It is the central application used by system operators to manage and supervise the integrity of the system as a whole.

  • EoN (Edge of Network) Nodes: EoN nodes act as physical or logical gateways for sensors and devices that do not use Sparkplug directly, allowing them to participate in the MQTT topic space. They manage the state and session of sensors and devices connected via protocols such as OPC UA, MODBUS, and others.

  • Devices and Sensors: Devices and sensors are essential in industrial automation, sending and receiving data through industrial poll/response protocols. In the Sparkplug context, they connect via EoN nodes, which bridge the gap between MQTT Sparkplug and these protocols. Devices compatible with MQTT Sparkplug can participate directly in the infrastructure as EoN nodes.

  • MQTT Application Nodes: MQTT application nodes participate in Sparkplug communication by producing and consuming messages, but they are not the SCADA/IIoT Host. These are generally software systems such as MES (Manufacturing Execution Systems) and Historians.

  • MQTT Broker: The MQTT broker acts as the data distribution center, connecting Sparkplug devices, EoN nodes, SCADA/IIoT Hosts, and applications. It manages authentication, authorization, and data distribution, being compatible with MQTT 3.1.1 to support features such as retained messages, LWT (Last Will and Testament), and QoS (Quality of Service).

These components work together to ensure efficient and scalable communication in the industrial automation environment.

Nexto PLCs with MQTT Sparkplug Support

To ensure performance and full operability in IIoT applications, the equipment in our Nexto family of programmable controllers features support for MQTT Sparkplug B.

Nexto PLCs are compatible with version 3.0.0 of the Sparkplug specification and utilize the Sparkplug B encoding scheme (namespace spBv1.0/#). This functionality allows products such as the NX3008 CPU and the Nexto Xpress compact controllers to fulfill the role of an EoN node within a Sparkplug infrastructure.

To assist in understanding and maximizing the benefits of this feature, our Altus R&D specialists have developed a detailed technical manual on the standard. The material provides in-depth descriptions of the architecture, topic structure, metric modeling, and practical implementation examples, offering a solid foundation for applying MQTT Sparkplug B in IIoT projects with Altus PLCs.

What you will find in this article

Share

Learn more