🎓 Lesson 3
D2
Modbus TCP to MQTT Translation Logic
Modbus TCP to MQTT translation is like converting instructions written in one factory language (Modbus) into another language (MQTT) so that older mining sensors can talk to modern cloud-based monitoring systems.
🎯 Learning Objectives
- ✓ Explain the functional role of a protocol translator in bridging Modbus TCP and MQTT within a mine site SCADA architecture
- ✓ Design a topic namespace and payload schema for MQTT messages derived from Modbus TCP register reads (e.g., holding registers 40001–40010)
- ✓ Analyze latency, reliability, and data fidelity trade-offs when configuring polling intervals and QoS levels for blast-critical sensor data
- ✓ Apply register-to-JSON mapping rules to convert raw Modbus byte sequences into semantically tagged MQTT payloads compliant with ISA-95 Level 0–1 data models
- ✓ Configure a lightweight edge translator (e.g., Node-RED or Eclipse Kura) to forward Modbus TCP data from a drill rig PLC to an MQTT broker with timestamped, retained messages
📖 Why This Matters
In active open-pit mines, blasthole drill rigs, shotcrete pumps, and magazine environmental monitors often run decades-old PLCs speaking Modbus TCP—but corporate safety dashboards, predictive maintenance AI, and regulatory reporting tools require real-time, contextualized data via MQTT. Without translation, these systems remain siloed, risking delayed blast readiness alerts, untraceable calibration drift, or noncompliant audit trails. This lesson bridges that gap—not with new hardware, but with precise, deterministic protocol logic.
📘 Core Principles
Translation hinges on three layers: (1) Transport mapping—Modbus TCP uses client-server request/response over port 502; MQTT uses asynchronous publish/subscribe over port 1883/8883 with broker mediation. (2) Data model alignment—Modbus has flat register spaces (coils, discrete inputs, input registers, holding registers); MQTT requires structured, hierarchical topics (e.g., mine/site/rig07/sensors/temperature) and self-describing payloads (e.g., {"value":23.4,"unit":"°C","ts":"2024-05-22T08:14:22Z"}). (3) Operational semantics—Modbus polls registers at fixed intervals; MQTT must emulate state awareness using retained messages and last-will announcements to signal device offline status during blast initiation blackouts.
📐 Payload Size Estimation & Bandwidth Budgeting
To avoid network congestion in bandwidth-constrained mine fiber/WiMAX links, engineers must estimate peak MQTT payload volume generated per Modbus poll cycle. This ensures reliable delivery during critical pre-blast data synchronization windows.
Estimated MQTT Payload Volume per Poll Cycle
V ≈ L_topic + L_payload + L_headerEstimates total byte count per MQTT PUBLISH packet to validate network budget compliance.
Variables:
| Symbol | Name | Unit | Description |
|---|---|---|---|
| L_topic | Topic string length | bytes | UTF-8 encoded length of MQTT topic (e.g., 'mine/south/shotcrete02/temp') |
| L_payload | JSON payload length | bytes | Size of structured JSON message including values, timestamps, and metadata |
| L_header | MQTT fixed + variable header size | bytes | Typically 2–5 B for small payloads; increases with topic/payload length per MQTT v3.1.1 spec |
Typical Ranges:
Single-sensor telemetry (8 registers): 120 - 200 bytes
Multi-parameter rig health (32 registers + diagnostics): 450 - 850 bytes
💡 Worked Example
Problem: A blasthole depth sensor PLC exposes 8 holding registers (40001–40008) via Modbus TCP. Each register is 16-bit integer. Translator publishes one JSON payload per poll containing all 8 values, plus ISO 8601 timestamp (26 chars), topic string ('mine/north/blast042/depth'), and metadata overhead. Assume UTF-8 encoding, no compression, QoS=1.
1.
Step 1: Calculate raw register data = 8 registers × 2 bytes = 16 B
2.
Step 2: Estimate JSON payload: {"depth_m":[12.4,12.7,12.5,...],"ts":"2024-05-22T08:14:22Z"} ≈ 142 B (measured in lab test on similar rig)
3.
Step 3: Add MQTT header (2–5 B), topic string (28 B), and QoS1 overhead (PUBACK round-trip not counted in payload size but affects latency) → total ≈ 175 B per publish
4.
Step 4: At 2-second polling interval → 175 B × 30 msg/min = 5.25 KB/min ≈ 0.7 kbps sustained — well below typical mine WiMAX uplink (≥2 Mbps)
Answer:
The result is ~0.7 kbps, which falls within the safe range of <1% of available uplink capacity on modern mine wireless backhaul.
🏗️ Real-World Application
At Newmont’s Boddington Mine (Western Australia), a Modbus TCP-to-MQTT bridge was deployed on ruggedized Raspberry Pi 4 units co-located with Sandvik DR400 drill rigs. The translator polls 12 registers every 1.5 s—covering hole depth, deviation angle, rotary pressure, and collar temperature—and publishes to topics like 'boddington/drills/dr400-127/sensors'. Payloads include ISA-95-compliant metadata (e.g., 'assetId': 'DR400-127', 'measurementId': 'hole_depth_m'). This enabled integration with AVEVA Edge for real-time blast pattern validation and reduced pre-blast data reconciliation time from 45 minutes to <90 seconds.
🔧 Interactive Calculator
🔧 Open SCADA System Integration Calculator📋 Case Connection
📋 Midwest Water Utility SCADA Modernization
Incompatible RTUs, no remote diagnostics, and chronic historian data loss during comms outages
📋 Offshore Wind Farm SCADA Integration with Grid Operator EMS
Real-time reactive power dispatch compliance with ±50ms latency SLA and cyber-certified data exchange
📋 Pharmaceutical Manufacturing Plant Batch SCADA Integration
Audit trail integrity across systems, electronic signature enforcement, and 21 CFR Part 11 compliance