Can AI write PLC code? Yes: large language models can produce readable IEC 61131-3 Structured Text and vendor tools can generate SCL and ladder. But the output needs line-by-line review and simulation by a competent engineer before it goes near a machine, and AI must never be relied on for safety functions.
Checked 28 October 2026. We read the 2023 ABB Research paper on arXiv (2305.15809), Siemens's product page and May 2025 press release, and the NCSC's AI guidance. We did not run a test of our own for this post, so nothing here is a claim about how accurate any tool is today.
The short answer: boilerplate yes, unattended no
AI is useful for first drafts, comments, test ideas and explaining old code. It is not a substitute for knowing the machine. The one thing the best evidence agrees on is that a person has to check the result. The rest of this post sets out what the research found, what vendors now sell, a checklist you can use, and what to keep out of a cloud tool.
What did the research find?
The best-known study is "ChatGPT for PLC/DCS Control Logic Generation" by Heiko Koziolek, Sten Gruener and Virendra Ashiwal of ABB Research, posted on arXiv on 25 May 2023 (arXiv:2305.15809). It is a preprint, not something we can call peer reviewed. The authors wrote 100 prompts in 10 categories and ran them through ChatGPT using GPT-4, asking for IEC 61131-3 Structured Text. The abstract says the model "generated syntactically correct IEC 61131-3 Structured Text code in many cases" and showed useful reasoning.
The paper is more cautious than the headlines built on it. In its own findings and threats-to-validity sections, the authors say:
- "ChatGPT answers require careful validation": answers can look correct but "contain subtle errors or omissions", and syntax problems are easy to spot by compiling, while semantic problems "may be harder to find".
- "Oversight of experienced control engineers is still required."
- "Many of the answers have not yet been compiled and thoroughly checked for functional correctness", and the quality scoring was informal.
- The generated code used newer language features, such as methods, that "may not be supported by all PLC environments".
- Text-based attempts at graphical notations such as function block diagrams "largely failed".
- Output was usually limited to "one or two screens" of code, and in many cases it could be faster for an experienced engineer to write the Structured Text directly.
This was GPT-4 in 2023, and it was an exploratory study, not a safety assessment. It tells you what was possible then. It does not tell you how any model performs today on your platform.
What do vendors offer now?
Siemens is the clearest example. A Siemens press release dated 12 May 2025, announced at Automate 2025, lists Industrial Copilots including an Engineering Copilot "Available for TIA Portal with Managed Service coming in 2025", able to "generate automation code through natural language inputs", with SCL code generation named. It says "Users retain complete control, selecting which tasks they wish to delegate to AI agents." The release does not use the word "beta".
When we opened the Siemens product page on 28 October 2026, the address we followed, which still contains "engineering-copilot-tia-standard", redirected to a page titled Eigen Engineering Agent. The page says it is connected to TIA Portal and "supports SCL and LAD generation by creating or adapting code, generating test logic, and fixing compile or syntax errors". It also covers HMI scripting, drive configuration and hardware and network configuration. To use it you need a licence for TIA Portal V19, V20 or V21 and an Industry Organization Account, and the page offers a free one-month trial.
Siemens's page carries marketing claims of 2 to 5 times faster execution and "Up to 80% higher solution quality". It gives no method or sample for them, so we do not treat them as evidence. It is a vendor's own description of its own product.

An engineer reviewing output on a screen is the right picture for this stage: the tool proposes, a person checks.
For a short look at what a vendor demonstration shows, here is Siemens's own video, which is promotional and about 2024's Industrial Copilot branding.
What does AI do well, and where does it fail?
Does well:
- Drafting structure: a state machine skeleton, a function block shell, or a routine for scaling an analogue value.
- Writing comments and documentation for code you give it.
- Suggesting test cases, and explaining unfamiliar or legacy logic.
- Translating between styles, which the Koziolek paper reports in its programmer-support examples.
Fails or needs care:
- Platform quirks. Instruction names, data types and library calls differ between Siemens, Rockwell, CODESYS and others, and a model can produce a plausible instruction your platform does not have.
- Timing and scan behaviour. A model does not feel scan time, interrupt priority or a slow device.
- Interlocks and fail-safe states. It does not know what your machine does when air pressure drops or a sensor fails.
- Your plant's tags and I/O. It only knows what you tell it.
- Safety. See below.
A 10-point review checklist before anything runs
- Read every line. If you cannot explain it, do not download it.
- Compile it on the target platform and fix every warning, not only errors.
- Map the I/O. Check every address and tag against the I/O list and drawings.
- Check interlocks and permissives. Confirm what must be true before each output turns on.
- Define fail-safe states. Power loss, comms loss and a broken wire should leave the machine safe.
- Keep safety out of AI hands. Safety functions are designed and validated separately.
- Check timing. Timers, scan assumptions and handshakes with other devices.
- Simulate first. Use a simulator such as the one built into your vendor's software, or an open runtime, with forced inputs, before any physical machine. Our free AI for PLC programming course shows how to do this safely.
- Use version control and keep the prompt with the code, so you can see what was asked and what changed.
- Get sign-off from a competent person, and test on site under your normal permit and commissioning procedure.
Why must a person sign off safety functions?
A safety function, such as an emergency stop, a guard interlock or a light curtain, is not ordinary control code. Standards such as ISO 13849 (safety-related parts of control systems) and IEC 62061 (functional safety of machinery control systems) set out how such functions are specified, designed and validated, and that means documented design and verification by people who are accountable for it. A model producing plausible code is not that process. We do not quote clauses or performance-level numbers here because we could not read the standards, which are sold. Our free machine safety, ISO 13849 and SISTEMA course explains the ideas.

The red emergency stop and the yellow safety sensor boxes in this photograph are exactly the equipment whose logic must be designed, validated and signed off by people, not generated and pasted in.
Is it safe to paste client code into an AI tool?
Not without checking. The NCSC's "AI and cyber security: what you need to know", published 13 February 2024, does not mention PLC code or say "do not paste code". What it does say bears on the question: it tells managers to be aware of AI-specific concerns around data security and to understand whether their organisation handles AI-related data in line with compliance requirements, and it warns that attackers can craft inputs to make a model reveal confidential information. From that, our own advice, which is not NCSC's wording, is to treat code, tag lists, network details and drawings from a client as confidential unless your contract and the tool's data terms clearly allow sharing, and to ask your client first.
What does this mean for a PLC career?
The evidence above points the same way: AI changes how fast a competent engineer drafts, and raises the value of someone who can review, simulate and commission. The Koziolek paper itself says experienced engineers are still required. It does not say jobs will or will not change, so we will not make a claim either way. A sensible plan is to learn the fundamentals first, then use AI as an assistant you check.
If you want a first look at the code side without a tool, try the free Siemens SCL and Structured Text course for TIA Portal. For a different video view, this tutorial from LEARNACON shows one person generating PLC code with AI for TIA Portal. It is one demonstration by a trainer, not a benchmark.
Start free
Learn the language before you lean on a tool: start with the free AI for PLC programming course and the free Siemens SCL course, then try days 1 to 5 of the PLC Programmer job simulation. A job simulation is practice, not employment. When you want to see what employers ask for, browse the PLC programmer role page. For the language basics, read our comparison of ladder logic and Structured Text. Nothing here promises a job, and no AI-written code is safe until a competent person has reviewed and tested it.





