Skip to content

PLC data in the cloud: architecture, security and costs

B2Bnetwork team · · 6 min

IT in manufacturing

In brief

PLC data reaches the cloud through an edge gateway in a separate network zone: the gateway reads the PLCs over OPC UA or the vendor's protocol, filters and buffers the data, and then opens its own encrypted outbound connection, usually MQTT, to a cloud service. The cloud never connects to the PLC and never controls the machine. Cost depends mainly on the number of tags, the read frequency, the retention period and how much data is aggregated at the line.

Architecture layers

A good architecture separates what has to run next to the machine from what can run far away. Each layer has different requirements for response time and security.

LayerWhere it sitsWhat it doesWhat it does not do
PLCat the machine, control networkcontrols the process, exposes tagsdoes not connect to the internet
Edge gatewayintermediate zone between OT and ITreads tags, filters, timestamps, buffersdoes not accept commands from the cloud to the PLC
Cloud ingestiona managed service or your own brokerreceives messages, checks the gateway's identityknows nothing about the PLCs
Time series storecloudkeeps raw data and aggregatesdoes not keep raw data forever
Analytics and reportscloud or the company data warehouseOEE, trends, models, reportsdoes not affect real-time control

Control loops and safety functions stay in the PLC. The cloud is for analysis, reports and models, and analysis results go back to people, not to the PLC. What to compute at the line and what centrally is covered in Edge computing in manufacturing and logistics.

Protocols and the data model

Between the PLC and the gateway, OPC UA or the PLC vendor's protocol is most common. Between the gateway and the cloud it is usually MQTT: a lightweight publish and subscribe protocol, whose 5.0 standard defines delivery guarantee levels (QoS 0, 1 and 2) and persistent sessions. Both protocols are compared in OPC UA and MQTT, and connecting machines without an Ethernet PLC in Machine data from legacy equipment.

The data model matters more than the protocol. Before the first tag reaches the cloud, agree on:

  1. A naming hierarchy: plant, hall, line, machine, signal, consistent with the codes in the ERP and MES.
  2. Units and types: Celsius or Fahrenheit, parts or cycles, integer or floating point.
  3. A timestamp assigned at the source, in one time zone, with the gateway clock synchronized.
  4. Value quality: whether a reading is good, uncertain or missing because of a connection failure.

Without this, data from three halls lands in the cloud under three naming conventions, and a report comparing lines turns into a data cleanup project.

Security: zones, identity, outbound traffic

Connecting the control network to the internet is the biggest change in risk in the whole project. NIST SP 800-82 and the IEC 62443 standards divide an installation into zones and the conduits between them. In practice it comes down to a few rules:

  • Outbound traffic only. The gateway connects to the cloud itself. The firewall lets no inbound connections into the OT network.
  • An intermediate zone. The gateway sits in its own zone, and the PLCs see neither the office network nor the internet.
  • Device identity. Each gateway has its own certificate and permissions only for its own topics, not one shared password for the whole plant.
  • Encryption of the cloud connection with TLS, and on the OPC UA side the signed and encrypted mode where the PLC supports it.
  • Read, not write. The gateway's account on the PLC can only read selected tags.
  • Updates and monitoring of the gateway like any other server, with its event log in the company's security system.

For entities covered by NIS2 (the EU directive on cybersecurity of essential and important entities), the gateway and the cloud service become part of a system whose security is management's responsibility. What an inventory and network segmentation look like in practice is shown in the case study on OT network segmentation in a chemical plant, and zoning principles in OT security in the plant.

What drives the cost

Cloud services usually charge for the number of messages, the amount of stored data, retention time, queries and data transfer. Prices depend on the provider and region, so it is more useful to know the multipliers.

An example to work with: 50 machines with 40 tags each, read every second, give 2,000 values per second, which is over 170 million values a day. The same machines sending only on change (with a deadband) and with one-minute aggregation for slowly changing temperatures usually produce many times fewer, depending on how often the signals really change.

FactorWhat reduces it
Number of tagssending only the ones someone uses
Frequencyreport by exception, a deadband, different rates for different signals
Retentionraw data kept briefly, aggregates kept long, older data in a cheaper storage tier
Queriesprepared aggregates for reports instead of computing from raw data on every refresh
Transfercompression and batching of messages in the gateway
Environmentsa separate, smaller test environment instead of a copy of production

Assign cloud costs to plants and lines from day one, as described in FinOps. Before go-live, also check which region the data lives in, covered in Cloud in Poland: regions and data location, and how the service copes with a burst of messages when many gateways reconnect at once, as in the case study on performance testing a system with encrypted device communication.

Platform, deployment and operations

A few dozen gateways across several plants are a fleet of devices: each needs configuration, a certificate, updates and monitoring. Manual configuration over remote desktop does not scale. It is better to describe the gateway and cloud service configuration as code, deploy changes through a pipeline with tests and have an automatic rollback to the previous version.

That is how we build platforms in our Platform and DevOps service: infrastructure as code, a CI/CD pipeline and monitoring, in Azure, AWS or the company's own data center. An example of a platform that collects data from lines of different generations and calculates OEE under one definition is the case study on near real-time production line data.

Questions and answers

Can a PLC be connected directly to the cloud?

Technically some PLCs allow it, but it is a bad idea. A PLC exposed to the internet becomes a target, and its security updates are rare. A gateway in an intermediate zone separates the control network, buffers data when the connection is down and lets you change configuration without touching the PLC program.

What happens to the data when the plant loses its internet connection?

The gateway stores the data locally and sends it when the connection is back, with the original timestamps. The buffer is sized for the longest outage you need to survive. Production does not depend on the cloud, because control stays in the PLC.

Can machine data stay in Poland?

Yes. It can be kept in the company's own data center, in a Polish data center or in a Polish cloud region, if the chosen provider has one. The choice depends on customer requirements, contracts and sector regulations. Write the region and the location of backups into the requirements before choosing a service.

How much does sending machine data to the cloud cost?

It depends on the number of tags, frequency, retention and how the data is queried, not on the number of machines. The same plant can pay many times less after introducing report by exception, aggregation in the gateway and shorter retention of raw data. Calculate it on a sample of real data before deciding.

What it looks like in a project

Connecting the shop floor with your business systems? Talk to an engineer who has worked on MES and OT.

Let's talk

Read more: IT in manufacturing

All in IT in manufacturing →