Skip to content
AI for PLC Programming
AI for PLC

AI for PLC Programming

TIA Portal · CODESYS · ST / SCL · Unit tests · Local or cloud · and more
The guide for automation engineers: what AI really delivers when programming a PLC, which tools exist, and how generated code reaches the controller verified.

How AI code gets into the PLC safely

01

Give context

The AI has to know the project: tag names, data types, existing blocks, your house standard. Without context it invents symbols.
02

Review the proposal

Generated code is a proposal. You read the diff, adjust and confirm. Nothing enters the controller silently.
03

Prove it

Import over the official API, compile against the real project, unit tests on PLCSIM Advanced or the real PLC.

AI for PLC programming: the guide

AI for PLC programming in 2026 means one concrete thing: a large language model (LLM) reads, writes, converts and explains controller code, above all Structured Text under IEC 61131-3 (ST, called SCL at Siemens), and a tool around the model makes sure the code fits the project and reaches the controller verified. The tools range from a chatbot in the browser, through vendor assistants such as Siemens Industrial Copilot, to integrated engineering IDEs such as AnyAutomation Studio that know the TIA Portal or CODESYS project. This guide shows what AI delivers when programming a PLC today, where it fails, how to recognise a usable tool, and what the path from prompt to controller looks like. The tools themselves are lined up in the comparison of AI tools for PLC programming.

What AI can do in PLC programming today

Five tasks where AI saves real time, in the order most teams adopt them:

  1. Understand and document. The AI reads an unfamiliar block (SCL, STL or a text form of the graphical languages), explains the logic, names states and interlocks, and writes the documentation. For existing plants this is the most common and lowest-risk entry point.
  2. Generate. A description ("FB for a conveyor with start/stop, seal-in and an overload interlock") becomes a block in ST/SCL. The result is usable when the AI knows the real tag names and data types of the project. How that works in TIA Portal is on Generate SCL with AI.
  3. Convert. Move STL legacy code to SCL, rebuild ladder logic as ST, migrate blocks between naming conventions. Pattern work where AI is fast and reliable.
  4. Refactor. Replace magic numbers with constants, clean up interfaces, bring comments up to date, structure a state machine properly.
  5. Test and troubleshoot. The AI writes unit tests for the block, explains a compile error, or finds the cause of a behaviour when it can see live values or a trace.

What is missing from this list is missing on purpose: safety functions (F-logic), hardware configuration without review, and anything that depends on assumptions about cycle time and peripherals. More on that below.

Structured Text first: which languages AI handles

Language models are text models. That is why AI for PLC programming works best with Structured Text (ST), called SCL at Siemens and ST under IEC 61131-3 at CODESYS and most other vendors. A model can also read STL, which makes it a good source for a conversion to SCL. For ladder (LAD) and FBD the AI needs a text representation: in TIA Portal that is SimaticML XML or, from V20, the textual S7DCL source; in CODESYS it is PLCopenXML. A tool that translates those formats makes graphical blocks readable for the AI and, with care, editable. AnyAutomation Studio edits LAD, FBD and GRAPH blocks as S7DCL source in the editor from TIA Portal V20 on.

Which AI tools exist for PLC programming?

Four categories that differ in context, data flow and pricing:

  • Vendor assistants. Siemens Industrial Copilot and its agentic successor, the Eigen Engineering Agent, for TIA Portal; TwinCAT Chat at Beckhoff; the FactoryTalk Design Studio Copilot at Rockwell; AI-supported engineering plus an MCP server at CODESYS; the PLC Code Generation Copilot at Schneider Electric. Deeply integrated, but tied to the vendor, the model and usually a cloud.
  • Independent engineering IDEs and assistants. AnyAutomation Studio (an IDE for TIA Portal V15-V21 and CODESYS with a free choice of model), T-IA Connect (an Openness layer with an MCP server for external AI clients), PLC Copilot, PLC Assist and SCLcode (chat and web generators next to the IDE).
  • General chatbots and coding agents. ChatGPT, Claude or Gemini in the browser, or Claude Code and Cursor with a community MCP server for TIA Portal. Free choice of model, but no project context, or a connection you build yourself.
  • Open source and research. MCP servers for TIA Openness on GitHub, prototypes such as LLM4PLC, Agents4PLC and AutoPLC, the Fraunhofer ChatPLC project. Good for understanding the technique, not meant for production.

The tools of all four categories are lined up with environment, model choice, local option, path into the project, testing and pricing in the comparison of AI tools for PLC programming.

Chatbot or integrated assistant: the difference is context

A chatbot in the browser does not know your project. It invents symbol names, guesses data types, and knows neither your house standard nor the blocks that already exist. The code looks plausible and does not compile, or worse: it compiles and still does not fit the plant. An integrated assistant reads the project before it writes: tag tables, data types, existing blocks, in TIA Portal over the official Openness API. The result fits on the first try far more often, and the import stays reproducible because it runs over the same API instead of copy and paste. What ChatGPT delivers without that context, and where it fails, is in the post ChatGPT for TIA Portal.

Cloud or local: may PLC code go to an LLM?

In many companies this question decides the whole deployment. Three answers are possible. Cloud under your own contract: you use Claude, GPT or Gemini with your own API key, or an enterprise offering such as Azure OpenAI, Vertex AI or AWS Bedrock; the data goes to the provider under your terms, not through a third-party server. Vendor cloud: with Industrial Copilot or the Eigen Engineering Agent the requests run over Siemens infrastructure. Local: a model via Ollama, LM Studio, vLLM or SGLang on your own hardware; inference never leaves the machine. For confidential plants, know-how-protected blocks and regulated industries the local option is often the only one that passes approval. AnyAutomation Studio supports all three paths and routes no request through a server of its own; details on AI for TIA Portal.

Limits: what AI must not do

An LLM does not replace a PLC programmer, and generated code does not belong on a plant unreviewed. Four limits apply regardless of tool:

  • Hallucinated system blocks. Language models occasionally invent calls or parameters that do not exist. A compile against the real project catches that; a chat window does not.
  • Timing and hardware. Assumptions about cycle time, peripherals, interrupt OBs or communication behaviour are yours to verify, not the model's to guess.
  • Safety-related logic. F-logic stays manual work with acceptance testing. Generate, yes, but only standard logic.
  • Responsibility. A human signs off. That is why a diff belongs before every import, and a test behind it.

Whoever uses AI for PLC programming seriously treats it like a fast junior: lots of output, always reviewed.

The workflow in AnyAutomation Studio

In AnyAutomation Studio the path from prompt to controller has three stages. First you describe the task in the chat; the assistant reads tags, data types and blocks of the TIA project over Openness (V15 through V21) or of the CODESYS project. Second it produces the block as a diff preview; you read, adjust, confirm. Third the code enters the project over the Openness API, is compiled, and is verified with SCL unit tests against PLCSIM Advanced or the real S7 PLC. You pick the model per task: Claude, GPT, Gemini, 20+ cloud providers or a local model. On top come Git, CI/CD, EPLAN import and the Forge block library that feeds the agent with your house standards. How the assistant works agentically beyond that is on the TIA Portal AI assistant page.

Frequently asked questions

Can AI program a PLC?

Yes, for standard logic in Structured Text (ST/SCL): generating, converting, refactoring, documenting and testing blocks. Not on its own and not unreviewed: the AI delivers proposals, a human reviews the diff, and the compile plus a unit test deliver the proof. Safety functions stay manual work.

Which AI tools exist for PLC programming?

Vendor assistants (Siemens Industrial Copilot and Eigen Engineering Agent, Beckhoff TwinCAT Chat, Rockwell FactoryTalk Design Studio Copilot, CODESYS AI engineering, Schneider PLC Code Generation Copilot), independent engineering IDEs and assistants (AnyAutomation Studio, T-IA Connect, PLC Copilot, PLC Assist, SCLcode), general chatbots and coding agents (ChatGPT, Claude, Gemini, Claude Code with an MCP server) and open-source and research projects. The comparison with a table is on the page Best AI for PLC programming.

Which AI is best for SCL in TIA Portal?

A strong reasoning model such as Claude, GPT or Gemini in its large variant for complex blocks, a fast coder model for completion while typing, a local model via Ollama for confidential projects. More important than the model is project context: the same AI writes far better SCL with access to tags and data types than without.

Can ChatGPT write PLC code?

ChatGPT explains SCL well and drafts usable scaffolds, but it does not know your project. Symbol names and data types are guessed, and the import is copy and paste. That works as a learning aid and for small blocks; project work needs an assistant with project context and an import over the Openness API.

Will AI replace PLC programmers?

No. It shifts the work: less typing of boilerplate and state machines, more specifying, reviewing and testing. Plant knowledge, safety assessment and the responsibility for sign-off stay with people.

Is AI-generated PLC code safe?

As safe as the process that brings it into the project. Without gates it is a risk. With a diff review, an import over the official API, a compile against the real project and unit tests on PLCSIM Advanced or the real PLC it is as safe as hand-written code with a review. Safety-related logic (F-logic) is not generated.

May I send PLC code to a cloud LLM?

Your approval process decides. Three paths: cloud under your own contract with the provider (including Azure OpenAI, Vertex AI, AWS Bedrock), a vendor cloud as with Siemens, or fully local via Ollama, LM Studio, vLLM or SGLang. AnyAutomation Studio supports all three and routes no request through a server of its own.

Is there AI for CODESYS?

Yes, the overview is on the page AI for CODESYS. CODESYS itself offers AI-supported engineering and an MCP server for external AI clients. AnyAutomation Studio opens CODESYS 3.5 projects, shows the objects as a tree, reads the code of a block and exports as PLCopenXML; the AI chat works with that context. Editing and writing back to CODESYS is planned for a later version.

Which AI migrates STL to SCL?

Any strong language model reads STL and converts to SCL. The difference is the tool: an integrated assistant reads the STL block straight from the project, keeps comments and interface, and the Openness import plus compile shows immediately whether the conversion is right. In AnyAutomation Studio that is one prompt: "Convert FC_LegacyPlant from STL to SCL and keep the comments."

Does AI work with ladder and FBD too?

Through a text representation, yes. In TIA Portal that is SimaticML XML or, from V20, the S7DCL source; in CODESYS it is PLCopenXML. AnyAutomation Studio edits LAD, FBD and GRAPH blocks as S7DCL source from TIA Portal V20 on. AI works best in Structured Text (ST/SCL), though.

What does AI for PLC programming cost?

Vendor assistants are subscriptions on the vendors' marketplaces, chat tools are monthly subscriptions, browser chatbots start at a free tier. In AnyAutomation Studio the AI chat is included from the Basic plan (CHF 10 per month or CHF 110 per year); add your own API key with the model provider, or a local model with no key. Try free for 30 days.

How do I get started with AI in PLC programming?

With the lowest-risk step: have an existing block explained and documented. Then generate a small standard block, read the diff, import, compile, test. Only when that loop runs smoothly, take on larger tasks. A tool with project context, diff preview and test integration gives you the guardrails; the workflow is on Generate SCL with AI.

// Comparison 2026

Which AI tools exist for PLC programming?

15 tools compared side by side: vendor assistants, independent IDEs, chatbots, open source. With a table, pricing and a decision guide.

// As of September 2026

AI in your PLC project

Describe your project → we'll show the way.