OPC-UA and MQTT Data Architecture for Smart Factories

By lamine yamal on March 31, 2026

opc-ua-mqtt-data-architecture-smart-factory

Every PLC on a factory floor speaks a different language. Siemens uses S7/PROFINET. Rockwell uses EtherNet/IP with CIP. Beckhoff uses ADS over EtherCAT. Mitsubishi uses MELSEC. Omron uses FINS. Legacy equipment still runs Modbus RTU over serial. Without a unified data architecture, connecting these machines to AI analytics, digital twins, and MES systems requires expensive custom adapters for every point-to-point connection — what the industry calls "spaghetti integration." Every new connection costs $5K-$20K in engineering, every adapter is brittle (one firmware update breaks it), and the result is a fragile web of integrations that nobody fully understands. The modern answer is the Unified Namespace: OPC-UA on the machine network because it handles the complex data structures of PLCs perfectly — self-describing, semantically rich, with metadata, units, and alarm limits — and MQTT with Sparkplug B for enterprise-wide event-driven streaming because it's lightweight, decoupled, and cloud-native. Leading PLC manufacturers including Siemens, Rockwell, Beckhoff, Schneider Electric, and ABB now embed OPC-UA servers directly into their controllers. Sparkplug B — ratified as an ISO/IEC international standard in 2023 — adds the standardized payload structure that raw MQTT lacks. We design the complete OPC-UA/MQTT data architecture for greenfield factories: protocol inventory, Unified Namespace topic tree, OPC-UA server configuration per PLC brand, MQTT broker placement with Sparkplug B payloads, edge gateway integration, and data quality management — so every machine speaks one language from commissioning day. Schedule a Demo

The Modern Factory Data Stack
OPC-UA for machine context. MQTT for enterprise transport. Sparkplug B for the dictionary.
Cloud / Enterprise
AI Analytics, Digital Twins, MES, ERP, Data Lake
MQTT 5.0 + Sparkplug B
MQTT Broker
Unified Namespace — single source of truth, pub/sub, event-driven
Protocol Translation
Edge Gateway
OPC-UA Client → Sparkplug B Publisher (Kepware, HighByte, Ignition Edge)
OPC-UA Client/Server
Machine Layer
PLCs (Siemens, Rockwell, Beckhoff, Mitsubishi) — OPC-UA Server embedded

Spaghetti Integration vs Unified Namespace

Point-to-Point Spaghetti
ConnectionsN×(N-1)/2 — every system connected to every other system directly
Integration Cost$5K-$20K per connection; 100 machines × 5 consumers = 500 integrations
New ConsumerMust integrate with every data source individually — weeks of engineering
FragilityOne PLC firmware update breaks all connected adapters
Data QualityNo standardized format — each connection has its own schema, units, timestamps
DiscoverabilityNobody knows what data exists until they ask the automation engineer
Unified Namespace (UNS)
ConnectionsN+M — every producer publishes once, every consumer subscribes once
Integration CostOne OPC-UA to MQTT bridge per machine; consumers auto-discover data
New ConsumerSubscribe to existing topics — minutes, not weeks. No changes to producers.
FragilityDecoupled — producer changes don't break consumers; broker handles routing
Data QualitySparkplug B enforces typed metrics, units, timestamps, quality codes
DiscoverabilityBirth certificates announce all available metrics automatically on connection

Still running point-to-point integrations? Schedule a demo to see how a Unified Namespace eliminates spaghetti connections and lets any new application subscribe to live production data in minutes.

Protocol Inventory: OPC-UA Support by PLC Brand

PLC BrandNative ProtocolOPC-UA SupportIntegration MethodCompanion Specs
Siemens S7-1500PROFINET, S7Native OPC-UA server built into CPUDirect OPC-UA connection; SiOME for modelingPackML, Euromap, Machine Tools
Rockwell ControlLogixEtherNet/IP, CIPVia FactoryTalk Linx GatewayFactoryTalk Gateway as OPC-UA serverPackML via Add-On Profile
Beckhoff TwinCAT 3ADS, EtherCATNative OPC-UA server and client in PLCDirect integration; Nodeset Editor for companion specsPackML, Euromap, Machine Tools
Schneider M580/M340Modbus TCP, Ethernet/IPOPC-UA server moduleEcoStruxure Machine Expert OPC-UAPackML, OMAC
ABB AC500PROFINET, ModbusNative OPC-UA serverDirect OPC-UA; Automation Builder configurationProcess automation companion specs
Mitsubishi iQ-RMELSEC, CC-Link IEOPC-UA server module (RD81OPC96)Module-based OPC-UA serverLimited companion spec support
Omron NJ/NXEtherNet/IP, FINSBuilt-in OPC-UA serverSysmac Studio configurationPackML
Legacy (Modbus RTU/TCP)Modbus RTU/TCPVia gateway (Kepware, Ignition)Software gateway with Modbus driver → OPC-UA serverN/A — manual data modeling required

Unified Namespace Topic Tree Design

Enterprise company_name
Site site_name (plant_chicago, plant_mumbai)
Area area_name (machining, assembly, packaging)
Line line_name (line_01, line_02)
Cell cell_name (cnc_01, robot_cell_03)
Tag tag_name (spindle_temp, cycle_count, fault_code)

Example MQTT Topic

spBv1.0/acme_corp/DDATA/plant_chicago/machining/line_01/cnc_01

Sparkplug B payload contains: metric name, value, data type, timestamp, and quality code — all in Protocol Buffer binary format for minimal bandwidth.

ISA-95 Alignment

The topic hierarchy follows ISA-95 equipment model levels: Enterprise → Site → Area → Line → Cell → Device. This ensures the namespace scales across multi-site, multi-plant organizations without topic collisions and maps directly to MES/ERP hierarchies.

OPC-UA: The Machine Dictionary

Self-Describing Data

OPC-UA doesn't just transmit "42.5" — it transmits 42.5°C, measured at 14:32:15.625, with "Good" quality status, from "Tank_01/Temperature", with alarm limits 10°C/80°C and engineering unit metadata. This semantic richness eliminates the need for external tag databases and makes data immediately usable by any consuming application without additional context mapping. A Modbus register gives you a raw number; OPC-UA gives you a fully described measurement.

Companion Specifications

OPC Foundation companion specifications define standardized information models for specific industries and machine types: PackML for packaging machines, Euromap for injection molding, OPC-UA for Machine Tools (umati), OPC-UA for Robotics, and dozens more. When a CNC machine exposes data via its companion specification, any OPC-UA client understands it as a machine tool — not just a list of variables. Over 80 companion specifications published, with 19+ manufacturers demonstrating interoperability in OPC Foundation's multi-vendor UAFX demonstrations.

Security Built In

X.509 certificate-based authentication, 256-bit encryption (AES-256-CBC), message signing, and role-based access control — built into the protocol, not bolted on. Every OPC-UA connection is mutually authenticated: the client proves its identity to the server, and the server proves its identity to the client. No shared passwords, no plaintext transmission. In greenfield, certificate management (PKI infrastructure) is designed as part of the OT security architecture during commissioning.

OPC-UA PubSub & TSN

OPC-UA Part 14 (PubSub) extends client/server with publish/subscribe over UDP multicast, MQTT, or AMQP. Combined with TSN (Time-Sensitive Networking), OPC-UA PubSub enables deterministic real-time communication between controllers — what the OPC Foundation calls OPC-UA FX (Field eXchange). Multi-vendor UAFX demonstrations with 19+ companies (ABB, Beckhoff, Rockwell, Siemens, Schneider) have proven controller-to-controller interoperability at SPS and IIFES trade shows.

MQTT + Sparkplug B: The Enterprise Transport

Why MQTT for Factory Data

MQTT's publish/subscribe model decouples data producers from consumers — machines publish once to a broker, and any number of consumers subscribe without the producer knowing or caring who's listening. Fixed header overhead is just 2 bytes (vs OPC-UA's kilobytes of session handshake certificates). Report-by-exception means data is only sent when it changes — reducing bandwidth by 80-90% compared to polled protocols. MQTT 5.0 adds shared subscriptions, topic aliases, and enhanced QoS for industrial requirements.

Why Sparkplug B Is Required

Raw MQTT has no payload standard — every device publishes in its own format (JSON, CSV, binary, plain text). Sparkplug B adds what raw MQTT lacks: standardized topic namespace (spBv1.0/group_id/message_type/edge_node_id), typed metrics with metadata (name, value, data type, timestamp), birth/death certificates for device state awareness, Protocol Buffer encoding for compact binary payloads, and report-by-exception with sequence numbering. Ratified as an ISO/IEC international standard, Sparkplug B ensures that any Sparkplug-compatible device is immediately discoverable and interpretable by any Sparkplug-compatible application.

MQTT Broker Architecture

On-premise MQTT broker (HiveMQ, EMQX, Mosquitto, or Cirrus Link Chariot) deployed in the factory server room as the central hub of the Unified Namespace. All edge gateways publish to the broker; all consuming applications (MES, AI analytics, digital twins, dashboards) subscribe from the broker. Broker clustered for high availability (active-active or active-passive). Bridge to cloud broker (Azure Event Grid, AWS IoT Core, HiveMQ Cloud) for enterprise-level analytics with firewall-safe outbound MQTT connections only — no inbound ports opened to the factory network.

QoS Levels

MQTT provides three Quality of Service levels: QoS 0 (at-most-once, fire-and-forget — suitable for high-frequency sensor telemetry where occasional loss is acceptable), QoS 1 (at-least-once — guaranteed delivery with possible duplicates, suitable for most industrial data), and QoS 2 (exactly-once — guaranteed single delivery, suitable for commands and setpoints). Sparkplug B uses QoS 1 by default and handles deduplication via sequence numbers in the payload. QoS level per topic is configured during the greenfield data architecture design phase.

Need a Unified Namespace designed for your greenfield factory? Schedule a demo to see how OPC-UA on the machine network and MQTT/Sparkplug B on the enterprise layer create a single source of truth for every machine, sensor, and application.

Edge Gateway Architecture

1
Protocol Acquisition

Edge gateway connects to PLCs via OPC-UA client, Modbus TCP/RTU driver, EtherNet/IP driver, or proprietary protocol driver. Software platforms: Kepware (PTC), Ignition Edge (Inductive Automation), HighByte Intelligence Hub, Node-RED with OPC-UA nodes. One gateway can connect to 10-50+ PLCs simultaneously. In greenfield: gateway software and hardware specified in the automation architecture; OPC-UA server licenses specified in PLC purchase orders.

2
Data Modeling & Transformation

Raw PLC tags transformed into the Unified Namespace structure: mapped to ISA-95 hierarchy, assigned engineering units, tagged with data quality indicators, and time-stamped with PTP-synchronized clocks. Deadband filtering configured per tag — only values that change beyond a configurable threshold are published, reducing network traffic by 80-90%. Data transformations (scaling, unit conversion, calculated values) performed at the edge before publishing.

3
Sparkplug B Publishing

Transformed data published to the MQTT broker as Sparkplug B payloads. NBIRTH message on connection announces all available metrics (the "birth certificate"). NDEATH message (Last Will and Testament) notifies all subscribers if the gateway loses connection. NDATA messages contain only changed values (report-by-exception). Protocol Buffer encoding reduces payload size 3× compared to JSON. Gateway handles store-and-forward: if the broker is temporarily unreachable, data is buffered locally and published when connection resumes — no data loss.

4
Security & Network Boundary

The edge gateway acts as the IT/OT security boundary. OPC-UA connections on the OT network (certificate-authenticated, encrypted). MQTT connection to broker on the IT/DMZ network (TLS 1.3, username/password or certificate). No direct connectivity between OT PLCs and IT/cloud systems. The gateway only initiates outbound MQTT connections — no inbound firewall ports opened to the OT network. IEC 62443 zone/conduit model enforced at the gateway level.

Key Benefits & ROI

1 Language Vendor-agnostic — Siemens, Rockwell, Beckhoff, legacy all speak OPC-UA
1 Truth Unified Namespace — single source of truth for every machine and sensor
Real-Time Event-driven MQTT — data published when it changes, not when polled
10→10K+ Scalable — from 10 data points to 10,000+ without architecture redesign
Open Standards-based — OPC-UA (IEC 62541), MQTT (OASIS), Sparkplug B (ISO/IEC)

Stop Building Custom Adapters. Build a Namespace.

iFactory designs unified OPC-UA/MQTT data architectures for greenfield factories — protocol inventory, Unified Namespace design, Sparkplug B configuration, edge gateway placement, and security architecture — so every machine speaks one language from commissioning day.

Frequently Asked Questions

OPC-UA vs MQTT — which should we use?
Both — they serve fundamentally different purposes and are complementary, not competing. OPC-UA is the machine dictionary: it handles the complex, semantically rich data structures of PLCs perfectly — self-describing variables with metadata, units, alarm limits, and type definitions. Use OPC-UA on the machine LAN for local communication between PLCs, SCADA, and edge gateways. MQTT is the enterprise envelope: it's lightweight (2-byte fixed header), decoupled (publish/subscribe), and bandwidth-efficient (report-by-exception). Use MQTT for streaming data from the edge to cloud/enterprise applications. The modern architecture uses an edge gateway to bridge the two: the gateway subscribes to OPC-UA servers on PLCs, strips the heavy session overhead, and publishes the values as Sparkplug B payloads to the MQTT broker. This gives you the richness of OPC-UA on the factory floor and the efficiency of MQTT for enterprise distribution.
What is a Unified Namespace?
A Unified Namespace (UNS) is a single, organized topic tree that hosts the current truth of operations — every machine, every sensor, every process variable published to a central MQTT broker using a standardized hierarchy. Producers (PLCs, sensors, MES systems) publish data once; any number of consumers (AI analytics, digital twins, dashboards, ERP) subscribe to the topics they need without direct connections to the data sources. The UNS follows the ISA-95 equipment model hierarchy: Enterprise → Site → Area → Line → Cell → Device → Tag. This ensures scalability across multi-site organizations and maps directly to MES/ERP structures. While often associated with MQTT, the UNS requires a semantic backbone — OPC-UA information models on the machine side and Sparkplug B payload structure on the MQTT side — to be truly scalable and interoperable. Without structured payloads, the UNS becomes a dumping ground of uninterpretable data.
How do you connect legacy PLCs without OPC-UA?
Through software gateways that provide protocol translation. Tools like Kepware (PTC), Ignition (Inductive Automation), MatrikonOPC, or Node-RED connect to legacy PLCs using their native protocols (Modbus RTU/TCP, Allen-Bradley DF1, Siemens S7 MPI, Mitsubishi MELSEC, Omron FINS) and expose the data as OPC-UA tags. The gateway acts as a virtual OPC-UA server — consumers see standardized OPC-UA address space regardless of the underlying PLC protocol. For very old equipment with no digital communication (24V/4-20mA signals only), industrial IoT gateways with analog/digital I/O convert physical signals to OPC-UA tags. In greenfield, legacy protocol gateways are specified during the automation design phase — ensuring every machine, regardless of age or brand, is connected to the Unified Namespace from day one. The key design decision is gateway placement: one gateway per machine (highest reliability) vs one gateway per production area (lowest cost).
What is Sparkplug B and why is it needed?
Sparkplug B is an open-source specification maintained by the Eclipse Foundation (now an ISO/IEC international standard) that adds what raw MQTT lacks for industrial use: a standardized topic namespace, typed payload definitions using Google Protocol Buffers (protobuf), and device state management through birth/death certificates. Without Sparkplug B, every device publishes MQTT data in its own format — different JSON schemas, different field names, different units — creating interoperability chaos at the broker. With Sparkplug B: every device announces its available metrics on connection (NBIRTH), subscribers automatically discover what data is available, payloads are compact binary (protobuf — 3x smaller than JSON), and if a device disconnects, all subscribers are immediately notified (NDEATH) and mark its data as stale. This state awareness is critical for industrial applications — you need to know not just the last value, but whether that value is still current.
Can we run OPC-UA and MQTT on the same network?
Yes — and in a well-designed architecture, they do. OPC-UA runs on the OT machine network (typically VLAN-isolated) for direct PLC communication. MQTT runs on the IT/DMZ network for enterprise data distribution. The edge gateway bridges the two, sitting on both networks with dual network interfaces. The gateway subscribes to OPC-UA servers on the OT side and publishes to the MQTT broker on the IT side. This separation is intentional: OPC-UA's client/server model with certificate authentication is appropriate for the trusted OT network, while MQTT's outbound-only connections through the DMZ firewall protect the OT network from external access. No inbound firewall ports are opened to the OT network. In greenfield, network VLANs, firewall rules, gateway interfaces, and certificate management are designed as part of the unified network and data architecture — not as separate projects that must be reconciled later. Schedule a demo to see how OPC-UA and MQTT coexist with proper IT/OT segmentation.

500 Custom Integrations or 1 Unified Namespace?

Every new application connected to your factory should take minutes, not weeks. OPC-UA + MQTT + Sparkplug B + proper architecture = subscribe and go.


Share This Story, Choose Your Platform!