Skip to content

CODESYS

CODESYS AI: assistant, agent and MCP

What AI really delivers in a CODESYS project: reading, explaining, generating and checking ST, which tools exist for it, and where the limits are.

CODESYS 3.5 · Structured Text · PLCopenXML · from Pro

What Studio does with CODESYS today

Studio edits, compiles, organizes, compares, exports and imports CODESYS projects, and the AI works on the same project.

  • Pro

    Open projects

    Studio connects to your locally installed CODESYS 3.5 development environment on the same machine.

  • Pro

    Object tree and ST editing

    Create, rename, move and delete objects in the tree, edit Structured Text in the editor and save it back.

  • Pro

    Compile, compare, exchange

    Compile with messages in the Problems view, compare with an export folder, export and import PLCopenXML.

  • Pro

    AI chat with project context

    The AI reads, changes and compiles ST code, creates and organizes objects, compares and imports, after your confirmation.

  • Pro+

    Go online

    Log in to the controller, download or apply an online change, start and stop the application, watch, write and force values.

  • Pro+

    Unit tests

    Test function blocks and functions on CODESYS Control Win, on a copy of the project, with history and reports.

  • Pro

    OPC UA client

    Connect to the OPC UA server of the controller, browse, watch values in watch tables and log them to CSV.

  • Pro+

    AI agent over OPC UA

    The agent builds watch tables, observes the running controller and writes values after you confirm.

Contents

In short: in AnyAutomation Studio the AI agent works inside your CODESYS 3.5 project. It lists and reads the objects, writes and changes Structured Text after your confirmation, compiles and fixes the errors, goes online to the controller and runs unit tests on CODESYS Control Win (Pro+), and observes the running controller through the built-in OPC UA client.

AI for CODESYS in 2026 means one concrete thing: a language model reads, writes, converts and explains Structured Text under IEC 61131-3, and a tool around the model makes sure the proposal fits the project and reaches the controller verified. The tools come from three directions. CODESYS itself offers, per the CODESYS documentation, AI-supported engineering inside its own development system and an MCP server for the CODESYS Development System that lets external AI clients work with the project. General chatbots such as ChatGPT, Claude or Gemini answer ST questions freely, but with no link to your project. And engineering IDEs such as AnyAutomation Studio open the CODESYS project and feed the AI chat with that context. This page sorts the three paths out. The basics are in the guide AI for PLC programming, the vendor-neutral overview of every tool is in the comparison of AI tools for PLC programming.

What AI can do with Structured Text in CODESYS

Language models are text models, and Structured Text is text. That is why ST is the language in which AI works most reliably in the CODESYS world. Five tasks where it saves real time:

  1. Understand and document. The AI reads an unfamiliar POU, explains the logic, names states and interlocks, and writes the documentation for it. For existing plants this is the most common and lowest-risk entry point, because nothing is written.
  2. Generate. A description ("function block for a conveyor with start, stop, seal-in and an overload interlock") becomes a block in ST. The result only becomes usable once the AI knows the real identifiers and data types of the project.
  3. Convert and port. Move code between naming conventions, rebuild logic from another controller world as ST, derive a state machine from pseudocode. Pattern work where models are fast.
  4. Refactor. Replace magic numbers with constants, clean up interfaces, bring comments up to date, give a state machine that grew over the years a proper structure.
  5. Draft test cases and narrow down faults. The AI proposes test cases for a block, explains a compiler message, or narrows down an observed behaviour when you give it the information it needs.

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

What CODESYS itself offers

The CODESYS Group has taken the vendor path. Per the CODESYS documentation it consists of three parts:

  • AI-supported engineering in the IDE. Assistance functions inside the CODESYS Development System that help with writing and understanding IEC 61131-3 code.
  • The MCP server for the CODESYS Development System. It exposes the project over the Model Context Protocol so that external AI clients can work with it. The upside: the choice of model is yours, because the client brings the AI. The price: installation, hardening and the gates around the generated code are the user's job.
  • The CODESYS Test Manager. The vendor's own test tool for automated testing in the CODESYS environment, a separate product next to the IDE.

These statements come from public CODESYS sources and product descriptions; the vendor is authoritative. If something is out of date, write to support@anyautomation.ch and we will correct it.

What AnyAutomation Studio does with CODESYS today

AnyAutomation Studio is an engineering IDE for Windows that connects to CODESYS alongside TIA Portal V15-V21. The CODESYS side does this today:

  • Open CODESYS 3.5 projects. Studio connects to your own, locally installed CODESYS development system on the same machine. Without a local CODESYS installation there is no CODESYS view, and the rest of Studio keeps working normally.
  • Show the objects as a tree. Applications, devices, folders and program blocks appear in the same nesting as in CODESYS, with a filter and multi-selection.
  • Edit a block's code. Clicking a POU opens its declaration in the editor, with a switch to the implementation. Structured Text is checked for syntax errors as you type and saved back into the project; if the object changed in the meantime, Studio shows the conflict instead of overwriting it. Code in ladder diagram, function block diagram, sequential function chart or instruction list opens read-only.
  • Compile. Studio compiles the project with your CODESYS installation and lists every error and warning in the Problems view, one click away from the line in the code.
  • Create and organize objects. Programs, function blocks, functions, methods, properties, interfaces, data types and global variable lists are created in Structured Text right in the tree, and objects are renamed, moved into folders and deleted after you confirm.
  • Export as PLCopenXML. Studio writes one PLCopenXML file per object into your export folder, the open, vendor-neutral exchange format for IEC 61131-3 code. That lets you archive blocks, keep them under version control, or take them into another tool.
  • Import PLCopenXML files back. Files from the export folder go back into the open project, also into a chosen folder; for an object of the same name you choose whether it is replaced, kept next to the import or skipped.
  • Compare with an export folder. Studio shows which objects changed, which exist only in the project or only in the folder, opens both versions side by side and brings single objects over in either direction.
  • Go online. Studio logs in to the controller with the user you enter, downloads or applies an online change, starts, stops and resets the application, and shows, writes and forces values in a Watch view. Every change to the controller asks for your confirmation first (Pro+ plan).
  • Unit tests for CODESYS blocks. Function blocks and functions are tested on CODESYS Control Win on the same computer, with the same Test Bench, history and reports as TIA blocks; the tests run on a copy, so your project stays unchanged (Pro+ plan).
  • The AI chat works with that context. The AI lists the objects of the open project, reads and explains a block's Structured Text, changes declarations and implementations, compiles the project and corrects its errors, creates, renames, moves and deletes objects, compares the project with a folder, exports or imports objects, goes online, reads, writes and forces values, and creates and runs unit tests. Every changing action asks for your confirmation first, and the AI never sees the password of the controller. For detailed ST work it hands the task to a dedicated CODESYS specialist that targets IEC 61131-3 and the CODESYS style rather than Siemens. Going online, working with values and the unit tests belong to the Pro+ plan in the chat as well.

Just as clear is what Studio does not do on the CODESYS side today: it does not edit graphical code, it does not compare two projects directly, and unit tests run only on CODESYS Control Win on the same computer. Besides going online through CODESYS, Studio can also reach the published variables of a CODESYS controller through its OPC UA server. CODESYS support is available from the Pro plan, going online and the unit tests from the Pro+ plan; on the free tier and the Basic plan an upgrade prompt appears instead.

CODESYS MCP server: what it does and when you need it

An MCP server exposes the CODESYS project to an AI client of your choice over the Model Context Protocol. It suits teams that already run a coding agent and want to connect it themselves: the model is free, but setup, permissions, review of every change and the test run are up to you. An agent IDE such as AnyAutomation Studio brings those parts with it: project context from the start, a confirmation before every change by default, a compile with the messages in the Problems view, unit tests on CODESYS Control Win, Git and the free choice of model, local models included. Both paths work with Structured Text; the difference is how much of the workflow you build yourself.

AI on the running CODESYS controller

Besides going online through CODESYS (Pro+), Studio connects to the OPC UA server of a CODESYS controller. Connecting, browsing, watch tables, the Data Logger and the agent work the same with a CODESYS controller and its OPC UA server as with a Siemens S7-1500: the agent builds the watch table, observes values and writes after you confirm. The OPC UA server of the controller needs a secured connection with a user name. Details on the page OPC UA client with AI.

Cloud or local: where may your CODESYS code go

In many companies this question decides whether AI is used at all. 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. Vendor cloud: with an assistant run by the controller vendor, the request travels over that vendor's infrastructure. Local: a model via Ollama, LM Studio, vLLM or SGLang on your own hardware, where inference never leaves the machine. For confidential plants, protected block libraries 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.

Limits

A language model does not replace an automation engineer, and generated ST does not belong on a plant unreviewed. Four limits apply regardless of tool:

  • Invented blocks and library calls. Models occasionally hallucinate functions, parameters or libraries that do not exist in your installation. A compile in CODESYS catches that; a chat window does not.
  • Timing and hardware. Cycle time, task configuration, peripherals and communication behaviour are yours to verify, not the model's to guess.
  • Safety-related logic. Safety stays manual work with acceptance testing. Generate, yes, but only standard logic.
  • Responsibility. A human signs off. Review and testing are not optional extras, they are the part that makes an AI proposal usable in the first place.

Whoever uses AI on a CODESYS project seriously treats it like a fast junior: lots of output, always read back.

Frequently asked questions

Is there a CODESYS AI assistant or AI agent?

Yes, on two paths. CODESYS documents AI-supported engineering inside its development system and an MCP server through which an external AI agent works with the project. AnyAutomation Studio adds an AI agent with CODESYS project context: it reads, explains and changes ST code, compiles the project, creates and organizes objects, compares and imports, each changing step after your confirmation, with the model of your choice.

Is there AI for CODESYS?

Yes, on several paths. CODESYS itself offers, per the CODESYS documentation, AI-supported engineering and an MCP server for external AI clients. Next to that are general chatbots with no project context and engineering IDEs such as AnyAutomation Studio that open a CODESYS project and feed the AI chat with that context.

Can ChatGPT write CODESYS code?

ChatGPT explains Structured Text well and drafts usable scaffolds, but it does not know your project. Identifiers and data types are guessed, library calls are sometimes invented, and the path into the project is copy and paste. As a learning aid and for small, isolated blocks that works. Project work needs a tool that knows the objects in the project, and in every case a compile in CODESYS.

What is the CODESYS MCP Server?

Per the CODESYS documentation, a server that exposes the CODESYS Development System to external AI clients over the Model Context Protocol. It lets a coding agent of your choice work with the project instead of you copying code back and forth. The choice of model stays free; installation, hardening and the review steps around the generated code stay with you.

Does AnyAutomation Studio support CODESYS?

Yes, from the Pro plan. Studio opens CODESYS 3.5 projects through your local CODESYS installation on the same machine, shows the objects as a tree, creates, renames, moves and deletes objects, edits Structured Text and saves it back, compiles the project, compares it with an export folder, exports and imports objects as PLCopenXML. From the Pro+ plan up, Studio goes online to the controller and runs unit tests on CODESYS Control Win. The AI chat works with that context. Details are in the CODESYS documentation.

Can the AI write into CODESYS?

Yes, after your confirmation. The AI replaces the declaration and the Structured Text implementation of an object directly in the project, and its confirmation shows the new code before anything is saved. It compiles the project afterwards, reads the errors and corrects its change. It also creates, renames, moves and deletes objects, imports PLCopenXML files, downloads to the controller, writes and forces values and runs unit tests, each after you confirm it. Graphical code is not part of it yet.

What does AI for CODESYS cost?

For the vendor tools the price follows the CODESYS Group's own offering; 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), CODESYS support from Pro (CHF 30 per month or CHF 330 per year), and Pro+ costs CHF 50 per month or CHF 550 per year. Add your own API key with the model provider, or a local model with no key. Try free for 30 days.

Does this work with TwinCAT or OMRON?

TwinCAT: no. TwinCAT is Beckhoff's engineering environment with its own tooling, including the vendor's TwinCAT Chat. AnyAutomation Studio connects to TIA Portal (V15-V21) and CODESYS 3.5, not to TwinCAT. Structured Text under IEC 61131-3 stays similar as a language, of course, but the tool chain does not. OMRON: yes, AnyAutomation Studio supports OMRON Sysmac Studio from the Pro+ plan, and the Structured Text skills of the agent carry over. More on AI for OMRON Sysmac Studio.

Is there a CODESYS copilot?

CODESYS documents AI-supported engineering inside its development system. If by copilot you mean an assistant that works in the project with you, AnyAutomation Studio offers one as an AI agent: it reads the CODESYS project, writes and compiles Structured Text after your confirmation and runs unit tests, with the model of your choice.

Does the OPC UA client work with CODESYS?

Yes. Studio has been tested with CODESYS Control and its OPC UA server: connecting with a user name over a signed or encrypted connection, browsing, watch tables, the Data Logger and the agent. Details on the page OPC UA client with AI.

Can I use Claude or Claude Code with CODESYS?

Yes. Claude in the browser explains and drafts Structured Text without project context. Claude Code can work with the project through the CODESYS MCP server, if you install and secure it. In AnyAutomation Studio you pick Claude as the model of the AI chat (with your Claude subscription or an Anthropic API key) and it works with the open CODESYS project. How Studio connects external MCP servers is in the post MCP in AnyAutomation Studio.

Which models can I use?

In AnyAutomation Studio you pick the model per task: Claude, GPT, Gemini and other cloud providers, more than 20 in all, with your own key, or a local model via Ollama, LM Studio, vLLM and SGLang. A strong reasoning model pays off for complex blocks, a small one for quick questions, the local one for confidential projects. No request runs through an AnyAutomation server.

Try it now

AI in your CODESYS project

Try AnyAutomation Studio free for 30 days, no credit card. For TIA Portal V15-V21 and CODESYS 3.5.

Free account required: sign in with your email address and a code, then the download starts.

Questions? support@anyautomation.ch