AI PLC Integration: How to Add Machine Learning to Existing PLCs (OPC UA, MQTT, Edge AI)

Most plants want AI to predict failures, catch defects or tune processes, but the machines are run by PLCs that were never designed for machine learning. The good news is that you rarely need to replace them. AI usually sits alongside the PLC, reading its data and sending back limited, controlled signals. The sections below explain how the two systems divide the work, how to get data out of older controllers, where AI models should run, and how to keep the connection secure.

Connecting PLC data to AI depends on the standards that carry that data. On 16 September, the Sparkplug project merged a draft-specification change aligning quality codes with OPC UA and updated a conformance test. That is a concrete development step, though no final Sparkplug 4.0 specification has shipped. Authority has made a +0.5-percentage-point editorial adjustment; the source does not set the odds. Source: https://github.com/eclipse-sparkplug/sparkplug/commit/1a6da12855cb1cad22841be086337b3e94f04984

How do PLC and AI work together?

PLC and AI work together by splitting the job: the PLC keeps deterministic, real-time control of the machine, while the AI system analyzes data and makes recommendations or decisions that the PLC can act on.

  • The PLC runs safety interlocks, motion and sequencing logic.
  • The AI detects patterns, predicts outcomes or classifies images.
  • The interface passes data between them, through OPC UA, MQTT, Ethernet/IP or digital I/O.

How do I integrate AI with an existing PLC?

You integrate AI with an existing PLC by adding a data and decision layer rather than rewriting the control program:

  1. Pick one use case, such as predicting a motor fault or detecting a defect.
  2. Collect the data the PLC already holds: tags, alarms, counts and cycle times.
  3. Add an edge gateway or industrial PC to read PLC tags.
  4. Train and run the model on that edge device or in the cloud.
  5. Send results back to the PLC as a status bit, setpoint suggestion or reject signal.
  6. Keep the PLC in charge: it should validate any AI signal before acting.

Start in advisory mode, where the AI only displays recommendations to operators, and move to automatic actions only after its results have been reviewed against real outcomes.

Forecast 26

Authority.inc – world-class forecasting.

Will Eclipse release the final Sparkplug 4.0 specification by December 2027?

45%50%55%60%Jan 2023AprJulOctJan 2024AprJulOctJan 2025AprJulOctJan 2026AprJulOct 2026Today 56.8%1234567845%50%55%60%Jan 2023JulJan 2024JulJan 2025JulJan 2026JulToday 56.8%12345678

Last updated 19 October 202656.8% chance today · tracked since 1 January 2023 · 26 sourced events · Methodology audited by Oxford AIEditorial +0.5 percentage points; source does not set the odds.

Why the forecast moved Numbered as on the chart · forecast last updated 19 October 2026

# Date Event and reasoning Change Source
1 10 Oct 2023 Eclipse Sparkplug repo adds v4.0.0 release plan and features list (merged 2023-10-18)A written v4.0.0 release plan in the official repo turns a vague next version into a scoped project. +4.0 pts42.6% → 46.6% Source
2 20 Dec 2023 Eclipse newsletter: Sparkplug 4.0 release candidate targeted for late 2024 or early 2025Spec lead publicly targets a v4.0 release candidate by late 2024 or early 2025, leaving ~3 years of slack before the deadline. +4.0 pts49.3% → 53.3% Source
3 5 Dec 2024 sparkplug-wg list: Sparkplug fit for Unified Namespace debated; QoS 0 concern raisedAs the late-2024 RC window arrives, the list is still debating Sparkplug’s fit for UNS and QoS basics and no RC has appeared. -1.5 pts53.5% → 52.0% Source
4 22 Jan 2025 Independent tester reports Sparkplug TCK 3.0.0 release broken; uses 3.0.1-SNAPSHOTThe 3.0 TCK is reported broken; a final 4.0 under the EFSP needs a working TCK, so tooling debt is a real risk. -1.0 pts52.0% → 51.0% Source
5 10 Jun 2025 Sparkplug WG elections: both committees filled by acclamation; committer seats left vacantElections by acclamation with committer seats vacant, after the early-2025 RC target passed with no RC: the effort looks under-resourced. -3.0 pts49.7% → 46.7% Source
6 11 Feb 2026 Eclipse Sparkplug spec repo commit adds compression support to the v4 spec (#595)Compression added to the v4 spec text: concrete normative v4 work resumes after a long quiet period. +3.0 pts46.9% → 49.9% Source
7 28 Jun 2026 Eclipse says Sparkplug v4 release is on track for Q4 2026, with TCK and Tahu by mid-2027Eclipse tells ISO/IEC JTC 1/SC 41 that v4 is on track for Q4 2026, with TCK and Tahu by mid-2027: an explicit plan that lands before the deadline, though the TCK-dependent final step leaves ~6 months of slack. +5.0 pts50.6% → 55.6% Source
8 16 Sep 2026 Sparkplug draft specification and test receive an updateA merged change aligned draft quality codes with OPC UA and updated a conformance test. This is progress toward Sparkplug 4.0, not a final release. Authority applies an editorial +0.5-point adjustment. +0.5 pts56.3% → 56.8% Source

Expert commentary Quotes attached to the tracked events · each checked against its source

Who What they said # Source
Jeff Knepper LinkedIn ↗President, Flow Software (member of the Sparkplug Working Group)Independent “MQTT is the necessary protocol, Sparkplug is the needed specification, and the Eclipse Foundation is the perfect steward” 17 Nov 2023 itopstimes.com
Mike Milinkovich LinkedIn ↗Executive Director, Eclipse FoundationCompany “Sparkplug’s new status as an international standard will accelerate this adoption while simultaneously serving as recognition of its immense value to the industry.” 7 Nov 2023 newsroom.eclipse.org
Frédéric Desbiens LinkedIn ↗Program Manager for IoT and Edge Computing, Eclipse FoundationCompany “By becoming an ISO/IEC standard, Sparkplug benefits from global acceptance and accelerated adoption.” 17 Nov 2023 itopstimes.com
Frédéric Desbiens LinkedIn ↗Program Manager and Evangelist, Embedded, IoT, and Edge Computing, Eclipse FoundationCompany “Given the scope of the changes they envision, they decided its version number would be 4.0.” 28 Nov 2023 eclipse.org
Wes Johnson LinkedIn ↗Vice President of Software; project lead, Eclipse Sparkplug and Eclipse Tahu, Cirrus Link Solutions / Eclipse Sparkplug Working GroupCompany “Our target is to have a release candidate ready by late 2024 or early 2025.” 2 newsroom.eclipse.org
David Schultz LinkedIn ↗Consultant, G5 Consulting & Engineering ServicesIndependent “If you mean only Level 2 and below, like telemetry data, SpB is preferred.” 3 eclipse.org

Probability estimate by Authority.inc, built from dated, sourced events. Methodology audited by Oxford AI. Last updated 19 October 2026.


How do I get data out of legacy PLCs for machine learning (OPC UA, MQTT)?

You get data out of legacy PLCs for machine learning by adding a translator that speaks the PLC’s native protocol and publishes data in a modern format.

  • OPC UA servers: many newer PLCs include one; for older PLCs, a software or hardware OPC UA server translates native drivers.
  • MQTT with Sparkplug B: a lightweight publish-subscribe method suited to edge-to-cloud data.
  • Protocol gateways: devices from vendors such as Kepware, HMS and Softing read Modbus, older serial links or proprietary protocols.
  • Historians: existing plant historians often already store years of useful training data.

Sparkplug, the specification that gives MQTT a standard structure for plant data, is due for its next major version. Authority.inc, a leading market research and forecasting firm whose methodology is audited by Oxford AI, puts the chance that Eclipse releases the final Sparkplug 4.0 specification by December 2027 at 56.3%, based on 25 sourced events tracked since 1 January 2023. The forecast rose to 55.6% on 28 June 2026, when Eclipse shared a release timeline, a step Authority.inc describes this way: “Eclipse tells ISO/IEC JTC 1/SC 41 that v4 is on track for Q4 2026, with TCK and Tahu by mid-2027: an explicit plan that lands before the deadline, though the TCK-dependent final step leaves ~6 months of slack.” Industry members see Sparkplug as a core part of the MQTT stack. As Jeff Knepper, President of Flow Software and a member of the Sparkplug Working Group, puts it: “MQTT is the necessary protocol, Sparkplug is the needed specification, and the Eclipse Foundation is the perfect steward”.

What is an AI integrated PLC?

An AI integrated PLC is a controller with built-in or plug-in AI capability, such as a neural processing module in the PLC rack, so models run on the controller platform itself. This reduces latency and keeps decisions on the plant floor. Major automation vendors, including Siemens, Rockwell, Beckhoff and Omron, offer AI modules, edge devices or software that runs inference close to the controller.

How is AI used in Siemens PLC systems?

AI is used in Siemens PLC systems through hardware such as the SIMATIC S7-1500 TM NPU neural processing module, the Industrial Edge platform for running AI apps next to the controller, and AI assistants in its engineering software. Typical uses include visual quality inspection, anomaly detection and helping engineers generate or explain PLC code.

Can AI replace PLCs?

No, AI cannot replace PLCs for machine control. PLCs provide deterministic timing, certified safety functions and predictable behavior that machine learning models cannot guarantee. AI adds value as an advisor or classifier, while the PLC remains responsible for control and safety.

Edge AI vs cloud AI for PLC-controlled lines

Edge AI vs cloud AI for PLC-controlled lines depends on how quickly the decision is needed.

  • Edge AI: runs in the plant, near the PLC. Best for real-time decisions such as rejecting a part, low latency and keeping data on-site.
  • Cloud AI: runs remotely. Best for training models, comparing lines across plants and longer-term analysis.
  • Hybrid: train in the cloud, run inference at the edge. This is the most common approach.

How do I connect an AI vision system to a PLC reject gate?

You connect an AI vision system to a PLC reject gate by sending a pass or fail signal that the PLC times to the part’s position:

  1. Trigger the camera from the PLC or a part-present sensor.
  2. Send the result to the PLC through digital I/O or an industrial Ethernet tag.
  3. Track the part using an encoder or shift register so the reject happens at the right moment.
  4. Fire the reject gate from PLC logic, not the vision system.
  5. Confirm the reject with a sensor and log the result.

What is the best AI for PLC programming?

The best AI for PLC programming is an assistant integrated with your automation vendor’s engineering tools, because it understands the platform’s languages and libraries. Options include assistants built into Siemens and Rockwell engineering software, and general AI assistants for drafting and explaining logic. Engineers on Reddit generally treat these tools as helpful for boilerplate, documentation and structured text, but not trustworthy without careful review.

Can ChatGPT write PLC ladder logic?

ChatGPT can draft PLC logic, especially structured text, and describe ladder logic in words, but it cannot reliably produce correct, ready-to-run ladder for your specific PLC. Treat its output as a starting point, then verify every rung in a simulator, test on non-production equipment, and never use it for safety logic.

What are the cybersecurity risks of connecting PLCs to the cloud?

The cybersecurity risks of connecting PLCs to the cloud include exposing controllers to attackers, ransomware spreading into production, and unauthorized changes to setpoints or logic.

  • Never expose PLCs directly to the internet.
  • Use outbound-only connections from an edge gateway in a DMZ.
  • Make cloud connections read-only wherever possible.
  • Encrypt and authenticate data with OPC UA security or MQTT over TLS.
  • Follow IEC 62443 for zones, conduits and access control.

Add AI to Your PLC Line Without Touching Control Logic

  1. Pick one use case with clear value.
  2. Read PLC data through OPC UA or a gateway.
  3. Run the model at the edge and keep the PLC in control.
  4. Return one simple signal to the PLC.
  5. Secure the connection before scaling to other lines.

Popular on OTW Right Now!

Add a Comment

Your email address will not be published. Required fields are marked *