# PLC code drafting and explanation (structured text yes, ladder with caution)

> PLC code drafting and explanation (structured text yes, ladder with caution)

- Canonical URL: https://aiagentsformanufacturing.com/use-cases/plc-code-drafting-and-explanation/
- Department: Engineering (https://aiagentsformanufacturing.com/departments/engineering/)
- Evidence level: Method. A proven way to do the task; no measured customer result for this exact workflow yet.
- Added: 2026-10-10
- Last updated: 2026-10-26
- Publisher: AI Agents for Manufacturing (https://aiagentsformanufacturing.com)
- Manufacturers named: Schaeffler (https://aiagentsformanufacturing.com/companies/schaeffler/), thyssenkrupp (https://aiagentsformanufacturing.com/companies/thyssenkrupp/)
- AI tools deployed: Siemens Industrial Copilot (https://aiagentsformanufacturing.com/tools/siemens-industrial-copilot/)

> Specialized case. Who this is for: Controls and automation engineers who write and maintain PLC programs (mainly structured text, IEC 61131-3) and can test generated code on a simulator or test bench before it reaches a machine. This case fits a specific context (a particular sector, process or piece of equipment) and applies to fewer companies than most others in the library; it stays here because it can be very useful to that audience.

## Role

Engineering. Typical users: controls engineer

## The problem

Controls engineers are scarce and spend much of their time on repetitive work: boilerplate function blocks, I/O mapping, alarm lists, HMI screens and documentation. Old programs written by someone who left are hard to read. General chatbots can write PLC code that looks correct but often does not compile or behaves wrongly on a real machine, because the details that matter (vendor dialect, timer behaviour, scan order, addressing) are invisible when you just read the code.

## How AI helps

An AI assistant drafts structured text (SCL/ST) or ladder logic from a plain-language description with the exact I/O list and wiring, explains existing code rung by rung, and generates comments, alarm texts and HMI screens. Integrated tools such as Siemens' copilot work inside the engineering software and can create code and visualisations directly in the project. The engineer compiles, simulates and tests every output before it touches a machine.

## Step by step

1. Start with low-risk work: explaining an existing program, writing comments, alarm texts, I/O lists and documentation, before generating new control logic.
2. For new code, give the AI everything a junior engineer would need: PLC brand, model and software version, language (ST/SCL or ladder), the exact I/O list with addresses, how each input is wired (normally open or closed) and the sequence of operation.
3. Ask for structured text first; it is plain text that models handle better than graphical ladder. Ask for ladder only when you can import and check it.
4. Require the AI to list its assumptions and the tag names it used, and to explain each rung or block.
5. Compile it in your engineering software and fix every error; paste the compiler errors back to the AI for a corrected version.
6. Simulate the logic, including abnormal cases: stop pressed during start-up, overload tripping, power loss, sensor failure.
7. Have a qualified controls engineer review the code against your standards before any download, and test on the machine with safety systems independent of the PLC logic.
8. Keep the prompt, the AI version and the review notes with the project for traceability.

## Tools

- Siemens Industrial Copilot for TIA Portal: used at Schaeffler and thyssenkrupp Automation Engineering (the newer Eigen Engineering Agent is a separate Siemens product, cited at ANDRITZ Metals, CASMT and Prism Systems)
- Rockwell FactoryTalk Design Studio Copilot, Beckhoff TwinCAT Chat, CODESYS AI assistants
- LADX (PLC code generation with a compile-and-check loop)
- General LLMs (ChatGPT, Claude, Copilot) for structured text, explanations and documentation
- To test before hardware, use a simulator for your PLC family: for example PLCSIM for Siemens (check the licence for your version) or the CODESYS simulation. Note that the free CLICK programming software has no offline simulator: ACC Automation tested on a connected CLICK PLC, after checking the logic shape in a free online ladder simulator

## Result

Siemens Industrial Copilot for TIA Portal (available since July 2024): Siemens says more than 100 companies were using it by late 2024, including Schaeffler and thyssenkrupp Automation Engineering, which planned a global roll-out from early 2025 to write SCL code, integrate it into TIA Portal projects and generate WinCC Unified screens. Siemens' stated figures: generated code needs only about 20% adaptation, and panel visualisations take about 30 seconds. The two Siemens products are separate: the 100+ companies, Schaeffler and thyssenkrupp above belong to Industrial Copilot. For its newer Eigen Engineering Agent, Siemens reports (Thailand launch release, 27 Aug 2026) use at 100+ companies in 19 countries, including ANDRITZ Metals, CASMT and Prism Systems, and engineering workflows 2–5 times faster than manual, across tasks that include PLC programming, HMI and device configuration, not only PLC code (all vendor figures; in the sources we read, no customer publishes its own measured savings). Independent test (one small task): ACC Automation gave ChatGPT and Claude the same motor start/stop task with a pre-start buzzer and normally-closed stop and overload wiring for a CLICK PLC; both produced logic judged correct and handled the normally-closed trap, because the prompt gave the exact I/O and wiring. The author then tested one of the programs on a connected PLC (CLICK has no offline simulator) and still advises a hardwired overload backstop. One motor example says nothing about success rates on larger programs. LADX's engineers explain why general models still fail: mixed vendor dialects, wrong timer types, ignoring scan order, and wrong address formats, which is why every output must be compiled and checked.

## Human review: cautions

- Never download AI-generated code to a running machine without compiling, simulating and review by a qualified engineer.
- Safety functions (e-stops, guards, light curtains) must stay on certified safety hardware and safety-rated code, never on AI-written standard logic.
- Speed-up figures here are vendor claims, with no published method (tasks, program size, time spent compiling, fixing and validating); we found no customer-published measured savings in the sources read.
- Do not paste proprietary programs or customer machine code into a public chatbot; use an approved tool.

## Try it yourself (prompt)

```text
You are a senior controls engineer. Write PLC code for the task below.

PLC: [brand, model, software and version]
Language: [Structured Text / SCL, or ladder]
I/O list (address, tag name, description, wiring NO/NC):
[paste list]
Sequence of operation:
[describe step by step, including start, stop, faults and resets]
Our standards: [naming convention, use of function blocks, alarm handling]

Tasks:
1. List your assumptions and anything missing from my description, as questions. If the wiring, the state after a power loss or the reset conditions are unclear, stop after the questions and do not write code.
2. Write the code with comments on every block or rung, using the tags above. If the sequence needs internal memory bits, timers or counters, list them separately and ask me to approve them.
3. Explain how normally-closed inputs are handled and how each fault stops the machine.
4. List the test cases I should run in simulation, including abnormal ones (stop during start-up, fault during run, power loss).
5. Say which parts must not be used for safety functions.
Use only the syntax of the PLC and software named above; do not mix vendor dialects.
Use only the data I paste in; if something is missing, write 'not found' or list it as a question instead of guessing. Do not send, order, post or change anything in any system: produce drafts for my review and approval.
```

## Related use cases

- [AI agents turn RFQ emails and long customer specifications into a matched, priced quote in minutes (IMS Gear, Maschinenfabrik Reinhausen, a power-grid components maker)](https://aiagentsformanufacturing.com/use-cases/ai-rfq-email-specification-to-quote-product-matching-ims-gear-reinhausen/)
- [AI drafts, checks and translates technical documentation and service manuals (Kistler, Bollinger Motors, Hitachi IES)](https://aiagentsformanufacturing.com/use-cases/ai-technical-documentation-manuals-drafting-translation-kistler-bollinger/)
- [Engineers ask questions of their standards, drawings and past project files and get an answer with the source page (Flender, NETZSCH, Victaulic)](https://aiagentsformanufacturing.com/use-cases/ai-engineering-knowledge-assistant-standards-drawings-past-projects-flender-netzsch/)
- [AI traces each engineering change to the parts, purchase orders, routings and work instructions it affects, before it reaches the floor (custom-assembly manufacturer, Cytovale)](https://aiagentsformanufacturing.com/use-cases/ai-engineering-change-impact-analysis-bom-routings-cytovale/)

## Sources

- https://press.siemens.com/jp/en/pressrelease/pr-20241024
- https://www.automationworld.com/factory/digital-transformation/news/55248289/thyssenkrupp-adopts-siemens-industrial-copilot
- https://news.siemens.com/en-us/eigen-launch-thailand/
- https://accautomation.ca/can-ai-actually-write-plc-code-i-put-it-to-the-test/
- https://ladx.ai/resources/why-chatgpt-ladder-logic-fails

## How to cite this case

AI Agents for Manufacturing. (2026). PLC code drafting and explanation (structured text yes, ladder with caution). Evidence level: Method. Last updated October 26, 2026. https://aiagentsformanufacturing.com/use-cases/plc-code-drafting-and-explanation/

Short form: Schaeffler, thyssenkrupp, as reported in "PLC code drafting and explanation", AI Agents for Manufacturing (Method evidence), https://aiagentsformanufacturing.com/use-cases/plc-code-drafting-and-explanation/

---
Please cite the canonical URL: https://aiagentsformanufacturing.com/use-cases/plc-code-drafting-and-explanation/
