EngineeringMethod A proven way to do the task; no measured customer result for this exact workflow yet.

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

Added 2026-10-10 · Last updated 2026-10-14

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.

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 / Eigen Engineering Agent in TIA Portal: used at Schaeffler and thyssenkrupp Automation Engineering
  • 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
  • Free simulators to test before hardware: CLICK programming software, PLCSIM, CODESYS simulation

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. 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 workflows 2–5 times faster than manual (all vendor figures; no customer has published its own measured savings). Independent test: 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 working ladder logic and correctly handled the normally-closed trap, because the prompt gave the exact I/O and wiring. 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; no customer has published measured savings yet.
  • Do not paste proprietary programs or customer machine code into a public chatbot; use an approved tool.

Try it yourself

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.
2. Write the code with comments on every block or rung, using only the tags above.
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.

Want more like this? Join the newsletter

Sources

Weekly: 1–2 practical AI use cases for your plant

Newsletter in

Free, one email a week. By subscribing you agree to receive the weekly newsletter (and its sponsor message) from AI Agents for Manufacturing. Every email includes an unsubscribe link, and you can unsubscribe anytime. See our Privacy Policy.