MQTT Topics & Wildcards: Application in the Manufacturing Industry

Content

In an increasingly connected production environment, the MQTT protocol is crucial for communication between machines and systems. To ensure optimal results, users should understand MQTT topics and the proper use of wildcards. This article offers an overview of MQTT topics and wildcards within the manufacturing industry and explains how to integrate them into ISA-95-compliant architectures.

 

What are MQTT Topics?

MQTT topics serve as communication channels in the MQTT protocol and enable devices to publish or subscribe to specific data streams (payloads). A topic is like an address that determines which messages are forwarded to which clients. They consist of simple character strings and follow a hierarchical structure, comparable to a computer’s file system. The slash (/) serves as a separator between the levels, similar to a file path such as “C:/User/…”. This structure enables a hierarchical organization of information within the MQTT broker. For example, a temperature sensor could use the following topic to transmit the process temperature of a specific work center:

MQTT Topic Hierarchy

This structure increases the flexibility and granularity of data exchange, as MQTT clients can only subscribe to and receive relevant information within the specified topic hierarchy.

 

Important Rules for Naming MQTT Topics

The naming of MQTT topics follows some important guidelines:

  • Case-sensitive: Topics are case-sensitive. For example, werk01/linie01/Maschine01 and werk01/linie01/maschine01 are two different topics.
  • UTF-8 characters: MQTT topics must consist of valid UTF-8 characters. Certain characters, such as “+” and “#” (for wildcards) and “$” (for MQTT system topics), must not be used indiscriminately as they have special functions.
  • Consistency: Consistent naming of topics is essential to avoid confusion and communication errors. This can be remedied by following standards such as ISA-95 (example: enterprise/werk01/assemblyline01/linie01/Maschine01).
  • Uniqueness: Avoiding duplicates in the topic naming facilitates seamless data exchange, especially from a business perspective. This becomes particularly clear when data is exchanged between brokers via standardized MQTT bridges. Unique topic names prevent topic conflicts.
  • Versioning: To optimize the further development of the MQTT namespace and the topic hierarchies, versioning should be integrated into the hierarchy. This enables simple management of changes and maintains backwards compatibility (example: mySpec_v1/…/areaID/lineID/cellID).

 

MQTT Topic Naming According to ISA-95

In a production environment, ISA-95 ensures consistent naming of MQTT topics. This generally enables clear and structured communication between all levels of the production process. The ISA-95 standard divides industrial systems into five levels, from the company level to the production level. MQTT topics can map this hierarchy directly and create a clear separation between plant levels, production lines, machines and process data. This facilitates targeted data transmission and the subscription of relevant information, even across factory boundaries.

MQTT Topic Hierarchy according to ISA-95

 

MQTT Wildcards and the Application in ISA-95 Environments

Wildcards are placeholders that make it possible to subscribe to a large number of topics without having to define each one manually. In the production environment, for example, events from all machines on a specific line can be subscribed to via a wildcard without having to address them individually. The following applies: only use wildcards when subscribing and not when publishing messages! There are two important wildcard types in MQTT:

  1. Plus sign (+): The “+” acts as a placeholder for exactly one level in the topic hierarchy. It replaces any name at this level. Example: production/plant01/+/machine01/status. This topic would record the status of machine01 from every production line within plant01, regardless of the production line.
  2. Hash character (#): The “#” is a multi-level wildcard that covers everything that follows the specified position. It must therefore always appear at the end of a topic. Example: fertigung/werk01/#. This would subscribe to all messages for Werk01, regardless of whether they originate from a specific line or machine.

 

Conclusion

The MQTT protocol is crucial in modern, connected manufacturing. Proper use of MQTT topics and wildcards allows for efficient, structured communication between machines and systems. By organizing topics hierarchically according to ISA-95 and utilizing wildcards, large data volumes can be managed in a targeted, flexible way, improving both performance and clarity.

About i-flow: i-flow is an industrial software company based in southern Germany. We offer manufacturers the world’s most intuitive software to connect factories at scale. Over 400 million data operations daily in production-critical environments not only demonstrate the scalability of the software, but also the deep trust our customers place in i-flow. Our success is based on close collaboration with customers and partners worldwide, including renowned Fortune 500 companies and industry leaders like Bosch.

Try it out now - free trial version

Experience the unlimited possibilities that i-flow offers by taking a test for yourself. Test now for 30 days free of charge on your systems.

Your question has not been answered? Contact us.

Your Contact:

Marieke Severiens (i-flow GmbH)
content@i-flow.io