How-to
Sending PLC data to an IoT hub without custom software
Short answer
You do not need custom software to move PLC data to an IoT hub: a configurable edge package with an S7, Modbus TCP or EtherNet/IP driver, a channel mapping and an MQTT publisher replaces hand-written acquisition code. Verify two things before you commit: the driver covers the protocol your controller actually speaks, and the publisher covers the destination's authentication and message format. Software still does the work — you configure it instead of writing it.
On this page
- What "no custom software" means at the edge
- Settle the protocol before you pick anything
- The no-code build, step by step
- Packages that cover the path without code
- What the publisher must cover
- Sizing the message flow for a 40-tag line at a 1 s poll
- Where custom code still earns its place
- The decision for each starting point
- Questions asked
No, you do not need to write custom software to move PLC data to an IoT hub. A configurable edge package — a PLC driver, a channel mapping and an MQTT publisher — replaces hand-written acquisition code for any controller that speaks S7, Modbus TCP or EtherNet/IP over Ethernet. Software still does the acquisition, the conversion and the transmission; the difference is that you configure existing components rather than develop them. Two checks decide whether the no-code route holds: the driver must cover the protocol your controller actually speaks, and the publisher must cover the destination's authentication and message format. The steps below run those checks, work one sizing example and end with a decision for each starting point.
What "no custom software" means at the edge #
Software always does the work — the distinction is who wrote it. Most third-party controllers do not natively speak a cloud hub's protocol, so Microsoft's guidance for connecting one starts where this article does: put an industrial gateway or edge PC between the controller and the hub, and register that device with the hub. An edge device is simply a computer near the equipment; it does not have to run Azure IoT Edge, which is a specific container runtime for modules that Microsoft describes as running Azure services, third-party services, or your own code. You need that runtime only when you want modules deployed and managed from the cloud.
If the controller exposes OPC UA rather than S7 or Modbus, the path is the same stack one layer up, and bridging OPC UA PLC data to MQTT with an edge PC walks it. Microsoft also publishes a sample OPC UA server that generates test values, so the hub side of the pipeline can be proven before the real controller is wired in.
Settle the protocol before you pick anything #
A controller brand is not a protocol, and the common spec-sheet phrase "Modbus TCP/485" names two different transports: Modbus TCP over Ethernet and Modbus over a serial line take different drivers and different physical interfaces. Establish three facts from the plant itself:
- The controller model and its configured communication interfaces, read from the controller project's own settings.
- The connection settings of whatever reads the controller today — protocol, destination address and addressing method. This shows whether that software owns the acquisition or merely exposes an interface to downstream consumers.
- One live value read through that interface and compared with the engineering display: right value, right data type, right unit.
If the value arrives but disagrees, fix addressing, byte order or scaling before anything touches the cloud, because a wrong value that reaches the hub is still a wrong value. The three acquisition protocols that make a no-code build realistic are S7 over Ethernet, Modbus TCP and EtherNet/IP; select from what the controller actually speaks, not from what a package happens to list.
The no-code build, step by step #
- Name the protocol. Read the controller's communication configuration and the current reading software's connection settings; write down protocol, destination and addressing method. Expected result: one named interface an external application can use.
- Prove one value. Read a single known process value through a test client and compare it with the engineering display. Expected result: matching value, data type and unit.
- Pick the package for that protocol. In the package's own documentation, for the version you will install, confirm the driver list names your protocol and a publisher exists for your destination. Expected result: both ends covered by one package, or a documented two-component path.
- Define the channels. Create the driver's asset or device entry and add one channel per tag, recording PLC address, data type, engineering unit, scaling rule, poll interval and cloud field name. Start with three to five tags whose values you can check independently. Expected result: a mapping table the next engineer can follow.
- Register the device and configure the publisher. Register the edge device or publisher identity with the hub, then set the publisher's authentication exactly as the hub documents it. Expected result: the publisher connects and accepts a test message.
- Prove one tag end to end. Send one channel to the hub and compare the value at the PLC, at the edge and in the cloud; then change a safe test value through an approved method and watch the cloud field follow. Expected result: the value tracks. A healthy connection status with a frozen value points to a stale cache or a wrong address, not to the network.
- Scale and size. Extend the channel list, then work the message volume with the arithmetic below and check it against the destination's message terms before calling the build done.
Packages that cover the path without code #
Four configured routes carry a controller to an IoT hub. They all run on one small computer near the line; if you are choosing that host now, a fanless industrial mini PC mounted in the cabinet beside the controller is the usual host for a connector stack that runs around the clock.
| Route | What you configure | Accept it when |
|---|---|---|
| Edge platform with PLC drivers, such as Eclipse Kura | S7 or Modbus driver, an asset holding your channels, the platform's cloud publisher pointed at the hub | the driver reads your real values and the publisher matches your hub's authentication |
| Node-RED flow | palette nodes for the PLC read and the MQTT publish, wired into one flow | the flow runs with no Function node inside |
| Edge MQTT broker with a native PLC source | the broker's S7 or Modbus source, a topic map, a bridge to the hub | the source names your controller model and the bridge implements the hub's authentication |
| Existing reading software retained | its supported downstream interface; the edge leg publishes only what that interface exposes | it provides access the replacement connector cannot reproduce |
Eclipse Kura documents S7 and Modbus drivers and a configurable cloud connection — verify both against your controller model and your hub in the release you install, because driver lists change between versions. Node-RED is configuration while it stays on palette nodes; installing Node-RED natively on a Linux edge computer sets up that host in a few commands. Brokers that also speak S7 exist as products; treat any of them as candidates to verify, not as substitutes for checking both ends of the path.
What the publisher must cover #
Acquisition proves only half the path. The publisher authenticates to the destination and sends messages in the form the destination accepts. A hub endpoint is not a generic MQTT broker: the device must be registered with the hub, the connection must carry credentials the hub issued, and topics and payloads must follow the hub's conventions — a desktop MQTT client pointed at the endpoint without those is refused. That is why registration sits inside Microsoft's guidance for third-party PLCs.
Choose the destination deliberately as well: Microsoft announced the retirement of Azure IoT Central in 2024, so a new build targets IoT Hub itself or another MQTT endpoint you control.
One boundary keeps the design sound: the edge PC initiates the only connection, outbound to the hub, and nothing is ever port-forwarded into the controller subnet.
Sizing the message flow for a 40-tag line at a 1 s poll #
The case is the one this article assumes throughout: a Siemens-class PLC read over Ethernet as S7 or Modbus TCP, an edge box between it and the hub, telemetry published as MQTT. Three inputs are declared example values — replace each with your own plant numbers:
- 40 process values on the line, polled together into one batched message per cycle.
- 1 s poll interval.
- 600 bytes per batched message, typical for 40 short values with names in a compact JSON payload.
The rule, in words: messages per day equal the seconds in a day divided by the poll interval, and bytes per day equal messages per day times payload size. The arithmetic:
- 86,400 s per day ÷ 1 s per poll = 86,400 messages per day.
- 86,400 messages × 600 B = 51,840,000 B per day, about 52 MB per day.
- 600 B per message × 8 bit/B × 1 message per second = 4,800 bit/s average, about 4.8 kbit/s.
- Publishing per tag instead: 40 × 86,400 = 3,456,000 messages per day, forty times the count, and every publish carries its own envelope bytes on top of the same values.
Decision: batch into one message per poll cycle. At these inputs that is 86,400 messages a day against 3.45 million, and 4.8 kbit/s average leaves any normal plant internet link essentially unloaded — message count, not bandwidth, is the number the destination's terms meter on, and batching cuts it by a factor of 40. If two or three values need faster refresh than the rest, give them their own channel and interval instead of shortening the whole line's poll.
Where custom code still earns its place #
None is needed for the standard case: S7, Modbus TCP or EtherNet/IP over Ethernet into an MQTT-speaking hub, values mapped channel by channel, published on an interval. Custom code earns its place only where a configured component has no answer:
- a controller speaking a proprietary serial protocol no driver covers;
- a transformation that channel scaling and configured nodes cannot express, such as a calculation spanning several tags;
- a destination offering only a software development kit and no MQTT endpoint;
- buffering demands beyond the package's own store-and-forward.
Scope the code to that one gap and leave acquisition and transmission configured around it. That is the difference between a small project and a codebase you own forever.
The decision for each starting point #
| Your starting point | Decision |
|---|---|
| Controller speaking S7 over Ethernet | No custom code: a driver-based edge platform or a broker with an S7 source, verified against your controller model, plus the hub publisher. |
| Device speaking Modbus TCP | Same path with the Modbus TCP driver; settle Ethernet versus serial first, because "Modbus TCP/485" on a spec sheet names both and decides nothing. |
| EtherNet/IP controller | Commit only after the package's driver list names EtherNet/IP for your version; if it does not, check whether the controller also exposes S7, Modbus or OPC UA and take the covered route. |
| Existing software already reads the PLC | Keep it and publish from the interface it exposes, unless the edge driver reproduces its acquisition completely; replace it only when that check passes. |
| Destination is IoT Hub | Registered device, hub-issued credentials, hub topic and payload conventions — configured in the publisher, not hand-written. |
Questions asked
Why not poll the PLC directly from the cloud?
A cloud-side poller needs the controller's port reachable from outside the plant, which is the one exposure to avoid. Keep the poller on an edge PC inside the plant network and let it publish outward. An edge host with store-and-forward also keeps collecting through a WAN outage and sends what it held once the link returns.
Does the edge computer have to run Azure IoT Edge?
No. Azure IoT Edge is a specific container runtime for cloud-deployed modules; it earns its place when you want modules managed from the cloud. A connector installed and configured directly on the edge computer moves the same data. Choose the runtime for operational reasons such as remote module deployment, not because the data path forces it.
Is a Node-RED flow custom software?
Not while it stays on palette nodes. Configured acquisition and publishing nodes are still configuration. A Function node, however, is JavaScript you write, so a flow full of Function nodes is exactly the custom code you set out to avoid. If a transformation cannot be expressed in configured nodes, scope that single function as your only custom piece.
What hardware does the connector stack need?
Check the package's own documentation for its stated minimum hardware, and run a compact industrial PC comfortably above it. Prefer a unit with two Ethernet interfaces: one for the controller network, one for the WAN side, so the box routes between segments without bridging them. Fanless mounting suits a cabinet next to the line.