ES
PLC to Cloud Connectivity: Protocols, Gateways, and Architectures

PLC to Cloud Connectivity: Protocols, Gateways, and Architectures

Guide to connecting PLCs and SCADA systems to cloud platforms using MQTT, OPC UA, REST APIs, and edge gateways for IIoT data collection.

Published on June 28, 2025

PLC to Cloud Connectivity

This guide explains how programmable logic controllers (PLCs) and SCADA systems connect to cloud platforms for Industrial Internet of Things (IIoT) applications. It covers the protocols (MQTT, OPC UA, REST), edge gateway roles, typical layered architectures, relevant standards and versions, and practical implementation steps you can apply to production systems. We emphasize security, interoperability, and operational resilience. Practicing engineers will find concrete recommendations backed by current specifications and vendor actions required for reliable PLC-to-cloud integration.

Key Concepts

Protocols and Data Flows

PLCs and SCADA systems commonly use three protocol families for cloud integration:

  • OPC UA (IEC 62541 series) – Provides a standardized information model, secure sessions, server/client semantics, and the PubSub extension for publisher/subscriber messaging. OPC UA handles synchronous reads/writes, subscriptions for real‑time change notifications, historical data access, and alarms/conditions. The OPC UA core has advanced to v1.05+ and includes PubSub over MQTT as defined in OPC UA Part 14 (PubSub binding) [1][6].
  • MQTT (ISO/IEC 20922, OASIS) – A lightweight publish/subscribe protocol designed for low-bandwidth and unreliable networks. MQTT v5.0 (OASIS / ISO/IEC 20922) adds richer metadata (user properties), reason codes, and flow control features. It supports QoS levels 0–2 to balance latency and delivery guarantees and commonly serves as the transport for cloud brokers (AWS IoT, Azure IoT Hub) [5].
  • REST/HTTP – Uses standard HTTP(S) request/response for on‑demand operations or bulk uploads (JSON or binary payloads). REST is ubiquitous and convenient for MES/ERP integration and dashboards, but it lacks native industrial semantics and streaming efficiency compared with OPC UA or MQTT [7].

Edge Gateways and OT/IT Boundary

Edge gateways perform protocol conversion, data filtering/aggregation, security mediation, and local buffering. A typical pattern is PLC/SCADA → Edge Gateway → Cloud Broker/API. Gateways (for example, Prosys OPC UA Forge or products from Come-Star/manubes) act as OPC UA clients to PLCs, map the PLC address space or Modbus registers into structured data, and then publish to MQTT brokers or directly to cloud APIs using HTTPS/REST [4][6]. Gateways also implement TLS, certificate stores, and retry logic to protect OT networks and reduce PLC load.

Architectural Layers

Standard layered architectures simplify design and secure the OT environment. A common pattern is:

  • Device Layer: PLCs and RTUs (e.g., Siemens S7‑1500, Rockwell ControlLogix) exposing native protocols (Profinet, Ethernet/IP, Modbus, native OPC UA servers).
  • Edge Layer: Gateways providing OPC UA client/server endpoints, Modbus drivers, protocol translation, local compute for analytics or filtering, and MQTT/REST adapters.
  • Transport Layer: MQTT brokers (Mosquitto, HiveMQ) or OPC UA PubSub over MQTT, secured with TLS and certificate-based authentication.
  • Cloud Layer: Cloud ingestion and services (AWS IoT Core, Azure IoT Hub, cloud databases, analytics platforms, and dashboards), often exposing REST APIs for upper‑layer systems.

This layered model enables OT/IT separation, reduces firewall changes (outbound MQTT/HTTPS connections only), and supports scalability via PubSub patterns and cloud brokers [1][2][4].

Standards and Security

Designs must follow standards for interoperability and security:

  • OPC UA (IEC 62541) – Defines data models, security (certificate exchange, secure channels, role-based access), and PubSub (Part 14) for MQTT bindings and other transports [1]. Current field deployments commonly reference v1.04–v1.05 and later for PubSub over MQTT support [1][6].
  • MQTT (ISO/IEC 20922 / OASIS v5.0) – Use MQTT v5.0 to leverage properties, enhanced error codes, and connection control. Protect MQTT with TLS and client identity via X.509 certificates or cloud IAM tokens [5].
  • HTTP/REST (RFC 7230 et al.) – Use HTTPS (TLS 1.2/1.3), OAuth2 or token-based authentication, and rate-limiting for cloud APIs [7].

All transports must use TLS, certificate pinning where possible, and automated certificate management for scale. OPC UA provides end‑to‑end security at the information model level, while MQTT and REST require careful IAM and broker configuration to enforce least privilege [1][3][6].

Implementation Guide

1. Assessment and Requirements

Begin with a formal assessment that documents:

  • Data types and volumes (sample rates, event frequency, expected messages per second).
  • Latency and determinism requirements (real‑time control vs. telemetry/analytics).
  • Security constraints (zones, firewall rules, compliance requirements like IEC 62443 recommendations).
  • PLC/SCADA capabilities (native OPC UA support, Modbus/TCP availability, CPU load limits). For example, many Siemens S7‑1500 models offer native OPC UA servers; older PLCs may require gateways [8].

2. Select Protocols and Architecture

Match protocol choices to use cases:

  • Use OPC UA for structured modelling, alarms, history, and bidirectional control when you need strong type definitions and access control. OPC UA fits local OT interactions and can be bridged to cloud transports via PubSub [1][6].
  • Use MQTT for efficient, low-bandwidth telemetry and scalable cloud ingestion—especially where many devices publish event-driven data. Prefer MQTT v5.0 for its richer feature set and properties [5].
  • Use REST for ad hoc queries, dashboards, and integrations with MES/ERP where synchronous request/response semantics are acceptable [7].

3. Design Data Models and Topic Schemas

Define a canonical data model at the edge. For OPC UA, use information models and companion specifications where possible; for MQTT, define topic namespaces that encode site, device, and variable identifiers. Example MQTT topic scheme:

  • site/siteId/line/lineId/device/deviceId/telemetry/sensorName

Map OPC UA nodeIds and variable metadata into MQTT payloads using OPC UA PubSub JSON encoding or custom JSON with timestamps, quality, and source nodeId to preserve semantics [1][6].

4. Edge Gateway Configuration

Configure edge gateways to:

  • Act as OPC UA clients to PLC servers or operate native drivers (Modbus/TCP, Ethernet/IP). Prosys OPC UA Forge and similar products offer converters that publish OPC UA address space to an MQTT broker and support OPC UA over MQTT binding [6].
  • Implement sampling/subscription rates on the gateway to avoid overloading PLC CPU cycles. Prefer OPC UA subscriptions over frequent polling whenever supported.
  • Perform local aggregation, compression, and schema validation to minimize cloud bandwidth usage and ensure consistent payloads.
  • Support secure bootstrapping and certificate rotation; automate trust list updates using management tooling.

5. Broker and Cloud Integration

Choose cloud services compatible with your protocol mix. Examples:

  • AWS IoT Core and Azure IoT Hub support MQTT bridges and can ingest MQTT v5 traffic. They also provide device registry, IAM, and message routing to storage and analytics [5].
  • Self‑hosted brokers such as Mosquitto v2.0+ or HiveMQ provide broker features and extensions; ensure your broker supports MQTT v5 if you need the newer features [5].
  • When using OPC UA over MQTT (PubSub), ensure broker compatibility with OPC UA payloads and consider using intermediate translator services for cloud-native storage and analytics [1][6].

6. Security Implementation

Apply multiple security layers:

  • Use TLS 1.2/1.3 for MQTT and HTTPS for REST. For OPC UA, use SecureChannel/TCP with certificates. Avoid plain TCP or unencrypted Modbus in production environments [1][3][5].
  • Authenticate devices with X.509 client certificates or cloud IAM tokens. Map certificates to device identities in cloud device registries to enforce RBAC.
  • Use MQTT QoS 1 or 2 for critical telemetry and configure message retention policies for reconnect scenarios. QoS 0 for non‑critical, high-frequency data to reduce broker load [5].
  • Enforce network segmentation and restrict inbound connections to the OT network; prefer outbound-only gateway connections to brokers to minimize firewall changes [4].

7. Testing, Validation, and Deployment

Validate under load with realistic message rates, message sizes, and failure modes (broker downtime, network partitions, certificate expiry). Include:

  • End‑to‑end latency measurements for control-critical paths.
  • Data integrity checks and schema validation at the cloud ingestion point.
  • Failover tests for gateway restart, message buffering, and cloud reconnection.

Deploy in stages—pilot, phased rollout per site/line—monitoring CPU and memory utilization on PLCs to ensure the integration does not interfere with control performance [8].

Best Practices

  • Prefer edge aggregation and filtering. Aggregate high-sample-rate signals at the gateway to reduce message counts and preserve PLC performance. Use OPC UA subscriptions and dead-band filtering where possible [1][6].
  • Use OPC UA locally, MQTT for cloud. Use OPC UA for structured OT interactions and map those models to MQTT/JSON for cloud telemetry—this preserves semantics and reduces cloud integration effort [1][3][6].
  • Tune MQTT QoS. Configure QoS 1 for most telemetry and QoS 2 for the smallest set of messages requiring exactly-once delivery (e.g., billing or safety-critical events). Balance QoS against broker and network capacity [5].
  • Automate certificate lifecycle. Avoid manual certificate management at scale. Use automated provisioning, rotation, and revocation workflows integrated with your cloud provider or private PKI [1][6].
  • Standardize topics and models. Create canonical topic naming, timestamp formats (ISO 8601), payload schemas, and versioning to avoid ad-hoc integrations and parsing complexity.
  • Plan for intermittent connectivity. Design gateways to buffer and forward messages with timestamps and to preserve event ordering where required. Use MQTT retained messages only for stateful values that represent the current state.
  • Monitor operational metrics. Collect metrics for gateway CPU, memory, queue depths, message latencies, and packet loss. Implement alerting for certificate expiration, failed subscriptions, and unusual message volumes.

Operational Considerations

Concrete operational guidelines from field experience include:

  • Minimize PLC-side polling: use subscriptions and event-driven models to reduce PLC CPU load and network chatter [6][8].
  • Test with real PLC models: Siemens S7‑1500 and Rockwell ControlLogix respond differently under heavy subscription loads—pilot testing is essential [8].
  • Document firewall outbound rules: typically allow outbound TLS on broker ports (e.g., 8883 for MQTT over TLS) to permit gateway-to-cloud connections without opening inbound OT ports [4][5].

Protocol Comparison

Protocol Standard / Key Version Transport QoS / Reliability Security Typical Use Cases Cloud Compatibility
MQTT OASIS / ISO/IEC 20922 (v5.0) TCP (TLS) QoS 0–2; retained messages TLS, client certs, token auth Telemetry, event notifications, low-bandwidth devices AWS IoT, Azure IoT Hub, Mosquitto, HiveMQ [5]
OPC UA IEC 62541 (v1.05+; Part 14 PubSub) TCP, HTTPS, MQTT (PubSub binding) Subscriptions, guaranteed delivery via PubSub options SecureChannel, certificates, role-based access Structured data models, alarms, historical access Local OPC UA servers; PubSub over MQTT to cloud brokers [1][6]
REST / HTTP RFC 7230+ / JSON HTTP(S) Request/response (no native QoS) TLS, OAuth2, API keys On-demand reads, uploads, dashboards, MES/ERP integration Any cloud platform or custom API endpoints [7]

Product and Compatibility Overview

Related Platforms

Related Services

Frequently Asked Questions

Need Engineering Support?

Our team is ready to help with your automation and engineering challenges.

sales@patrion.net
Product / Component