Local AI for PLC programming: IEC 61131-3 Structured Text with an offline coding model
Eurokommerz, Vienna, since 2006: Private AI/ML · IT Managed Services · Enterprise Training · AI Hardware & Software
- IEC 61131-3:2025 (edition 4, May 2025) names Structured Text (ST) as its textual language and ladder diagram and function block diagram as graphical ones; the 2013 edition also listed Instruction List as a textual language
- In the LLM4PLC study (ICSE-SEIP 2024), a pipeline with a syntax checker and a model checker raised the success rate of generated PLC code from 47 % to 72 %; the 2026 SemaPLC paper reached 72.6 % on function tasks with its skills, tools and logged compiler and runtime checks, against 55.3 % for the same models without them
- Open coding models such as Qwen3-Coder-30B-A3B (31.2 GB in FP8) and Qwen3-Coder-Next (80B total, 3B active) are Apache 2.0 and run without any internet connection
- By our users-per-card rule one NVIDIA RTX PRO 5000 Blackwell 72 GB holds Qwen3-Coder-30B-A3B with 10 sessions of 32,768 tokens; a workstation with two cards holds Qwen3-Coder-Next with 58, at about 1.1 kW by our estimate
- Safety functions stay outside the assistant: the EU Machinery Regulation separates software that learns from software that is only programmed to execute certain automated functions
Supplied by Eurokommerz: RTX PRO 6000 and H200 NVL Check price and availability →
What a local AI does for PLC programmers
Local AI for PLC programming is an open coding model that runs on a workstation or server inside your network and works with IEC 61131-3 code: it drafts Structured Text function blocks from a description, reviews and explains existing programs, writes documentation for legacy code and proposes test cases. Every output goes through your own compiler and tests before it reaches a machine, and the customers' machine code never leaves the building. For a controls team of up to a few dozen engineers, a workstation with one or two NVIDIA RTX PRO 5000 Blackwell 72 GB cards is enough by our estimate; a two-card RTX PRO 6000 Server Edition server suits a company that runs other AI tasks on the same machine.
This guide is for heads of automation and the IT staff who support a controls department at a machine builder, a system integrator or a plant operator. Our guide to a private coding assistant covers general software teams, and our page on a server for coding agents sizes agents with long prompts. This page covers what is different about PLC code: the languages, the scarce public training data, the verification loop and the line that safety code does not cross.
Machine builders have a particular reason to keep this work local. The application code of a machine may belong to the customer or fall under a non-disclosure agreement, and integrators often work with code that belongs to the plant operator. Our article on trade secrets, NDAs and AI tools covers the contractual side; your legal counsel confirms what your contracts allow.
IEC 61131-3 in 2026: which languages a model can read
The fourth edition of IEC 61131-3 was published in May 2025 and replaces the 2013 edition. Its abstract describes "a unified suite of programming languages": the textual language structured text (ST), the graphical languages ladder diagram (LD) and function block diagram (FBD), and sequential function chart (SFC) elements for structuring programs and function blocks. The abstract of the 2013 edition listed two textual languages, Instruction List (IL) and ST. The significant changes named for 2025 are UTF-8 strings and an Annex B listing features "added, removed or deprecated"; the abstract does not list what Annex B contains, so check it for the status of IL in your toolchain.
| LANGUAGE | FORM | WHAT A MODEL GETS |
|---|---|---|
| Structured Text (ST) | text | the source code itself |
| Instruction List (IL) | text, older code | the source code; 2013 edition |
| Ladder diagram (LD) | graphics | an XML export of the network |
| Function block diagram | graphics | an XML export of the network |
| Sequential function chart | graphics and text | steps and transitions as text or XML |
Abstracts of IEC 61131-3:2025 and IEC 61131-3:2013 on the AFNOR and ANSI webstores; PLCopen page on the XML exchange format; all read 25 October 2026. "What a model gets" is our assessment.
A language model reads and writes text. ST is therefore where it helps most: a function block in ST is source code the model can draft, explain and change. Graphical networks reach the model only as an export. PLCopen's TC6 XML format is "an open interface which can be used by different kinds of software tools", captures graphical details such as "where the function blocks are and how they are connected to each other", is at version 2.01 and was published as IEC 61131-10 in April 2019. A model can explain the logic of an exported ladder network from such a file; writing a correct graphical network back into an engineering tool is a much harder task, and we would not plan on it.
Each engineering tool also adds its own extensions, system libraries and conventions to the standard. Tell the model in the system prompt which tool and version the code is for, and give it examples from your own projects.
Why general coding models need context and checks
PLC languages are a small niche next to the languages most coding models learn from, and the research says so. The LLM4PLC paper, by the University of California, Irvine and Siemens Technology, presented at ICSE-SEIP in April 2024, names "suboptimal support for essential but niche programming languages" as the problem it addresses. Its pipeline checked generated code with the MATIEC compiler for syntax errors and with the NuXmv model checker against a specification, and fed the errors back to the model. That raised the generation success rate "from 47% to 72%" and the experts' quality rating from 2.25 to 7.75 out of 10; the best pass rate, 72.5 %, came from a fine-tuned Code Llama 34B.
The SemaPLC paper (arXiv, August 2026) goes one step further and works inside existing PLC projects. Its agent "retrieves the project structure and locates the relevant modules", uses "a curated wiki" of function-block signatures, control patterns and compiler pitfalls, and declares a task complete "only when logged external checks confirm it": specification, compilation with the RuSTy compiler and behaviour on a live PLC runtime. With seven backbone models, the full method passed 72.6 % of function tasks on average against 55.3 % for the same models without its skills and tools, and on the project track it built 89.4 % of programs against 58.7 to 81.5 % for the other methods.
Two conclusions follow for a controls team. The model is one part of the system; your own function-block library, naming rules and a compiler in the loop make most of the difference. And because the published methods used cloud models, open models in your network have to be measured on your own tasks before you rely on them.
Four jobs for a controls team
| JOB | INPUT | WHO CHECKS |
|---|---|---|
| Draft an ST function block | description, interface, examples | compiler, tests, engineer |
| Review and explain code | existing ST or exported networks | engineer |
| Document legacy programs | old projects, I/O lists | engineer, commissioning |
| Propose test cases | function block and specification | engineer, test runtime |
Our summary of typical uses; the checking steps follow the verification loops of the LLM4PLC and SemaPLC papers.
Drafting function blocks. The engineer describes the behaviour and the interface, and the model drafts the block in your dialect, with examples of similar blocks from your library in the prompt. A retrieval index over your library finds those examples by description, as our guide to RAG on company data explains. The compiler runs on every draft, and errors go back to the model automatically.
Reviewing and documenting. Older machines often run programs that nobody on the current team wrote. The model reads a program block by block and writes a description of each block, its inputs and outputs, its states and the timers and interlocks it uses. The commissioning engineer checks the description against the machine. For a team that is losing experienced engineers, our article on capturing expert knowledge before retirement covers the interviews and documents around the code.
Converting older code. Where a project still contains IL, a model can draft an ST version block by block. Treat the result as new code: compile it, test it on a simulator or a test runtime and compare its behaviour with the original before it replaces anything.
Test cases. From a function block and its specification, the model proposes input sequences and expected outputs for your unit-test framework or a golden trace on a runtime, which is how SemaPLC judged behaviour.
Safety functions stay outside the assistant
We recommend a firm line: code for safety functions, such as emergency stops, guard interlocks and safety PLC programs, is written and verified by qualified engineers by the methods your safety standards prescribe, without an AI draft. The assistant may explain the standard program around it, never the safety program itself.
The EU Machinery Regulation (EU) 2023/1230 draws a related line for products. Recital 54 places "systems with self-evolving behaviour ensuring safety functions" in Annex I with third-party conformity assessment, and recital 55 states that "those provisions should not apply to software incapable of learning or evolving" that is programmed only to execute certain automated functions. Code drafted with an assistant and then reviewed and compiled is ordinary deterministic code on the controller; how your product and its documentation fall under the Regulation is a question for your legal counsel and your notified body. Our article on machine manuals and the Machinery Regulation covers the documentation side.
We supply RTX PRO 5000 workstations and RTX PRO 6000 Server Edition servers and set up the model, the library index and the compiler loop; send us your engineering tools, team size and a sample block, and our team replies with a configuration.
Models, memory and sessions
| MODEL | TOTAL / ACTIVE | WEIGHTS | CACHE PER 32K | LICENCE |
|---|---|---|---|---|
| Qwen3-Coder-30B-A3B | 30.5B / 3.3B | 31.2 GB FP8 | 3 GiB | Apache 2.0 |
| Qwen3-Coder-Next | 80B / 3B | 80.3 GB FP8 | 0.75 GiB + state | Apache 2.0 |
| gpt-oss-120b | 117B / 5.1B | about 65 GB MXFP4 | 1.125 GiB | Apache 2.0 |
Hugging Face model cards, config.json files and file lists (sum of the safetensors files), read 25 October 2026. Cache per session of 32,768 tokens in 16-bit by our arithmetic from each config.json; Qwen3-Coder-Next adds a fixed linear-attention state of under 80 MiB per session by our estimate.
All three are general coding or reasoning models with Apache 2.0 licences; none is trained for PLC languages, and none of the cards reports a PLC benchmark. Qwen3-Coder-30B-A3B is the smallest that still handles long files, with 48 layers, 4 key/value heads of dimension 128 and a native context of 262,144 tokens. Qwen3-Coder-Next keeps a per-token cache in only 12 of its 48 layers, so long sessions cost little memory. The Qwen3-Coder cards state that both models support only non-thinking mode, which suits drafting and review, and both support tool calling for a compiler loop.
We size sessions of 32,768 tokens: the system prompt with your conventions, a few library blocks, the block under work and the compiler output. Our users-per-card rule takes 90 per cent of the memory the driver reports and subtracts 3 GiB per card, as our guide on how many users one RTX PRO 6000 serves derives. For the 72 GB RTX PRO 5000 we scale the 95.6 GiB that a 96 GB card reports to 71.7 GiB, which leaves 61.5 GiB per card by our estimate.
| HARDWARE | USABLE MEMORY | MODEL | SESSIONS OF 32K |
|---|---|---|---|
| 1 × RTX PRO 5000 72 GB | 61.5 GiB | Qwen3-Coder-30B-A3B | 10 |
| 2 × RTX PRO 5000 72 GB | 123.1 GiB | Qwen3-Coder-Next, pair | 58 |
| 2 × RTX PRO 5000 72 GB | 123.1 GiB | gpt-oss-120b, pair | 55 |
| 2 × RTX PRO 6000 Server Ed. | 166.1 GiB | Qwen3-Coder-Next, pair | 110 |
Our estimates by the users-per-card rule, not measurements; 16-bit cache. Weights 29.0 GiB (Qwen3-Coder-30B-A3B), 74.8 GiB (Qwen3-Coder-Next) and 60.8 GiB (gpt-oss-120b). Sessions with 64K tokens: about half.
A session here is a request the engine works on at that moment. An engineer reading a draft or testing it holds none, so ten sessions serve a team of twenty or more engineers by our estimate; your gateway logs show the real figure. gpt-oss-120b leaves only 0.7 GiB on one 72 GB card, so it needs the pair. An FP8 cache roughly doubles the counts and should be checked for quality on your own tasks first.
Workstation in the controls office or a team server
| OPTION | WHERE | SUITS | POWER (ESTIMATE) |
|---|---|---|---|
| 1 × RTX PRO 5000 72 GB | workstation, controls office | a pilot, a small team | about 0.75 kW |
| 2 × RTX PRO 5000 72 GB | workstation, controls office | a team with long sessions | about 1.1 kW |
| 2 × RTX PRO 6000 Server Ed. | server in a server room | PLC work plus other departments | about 1.8 kW |
Our estimates: board power (300 W per RTX PRO 5000, 600 W per RTX PRO 6000 Server Edition) plus processors (Threadripper PRO 9975WX at 350 W, two EPYC 9135 at 200 W) plus 15 per cent for the rest, as on our RTX PRO 5000 workstation page and the entry configuration on our AI servers page.
A workstation with one or two RTX PRO 5000 72 GB. The NVIDIA RTX PRO 5000 Blackwell has 72 GB of GDDR7 with ECC, 1,344 GB/s and 300 W per card, with an active cooler for a workstation. Two cards run on an ordinary 230 V office circuit at about 1.1 kW by our estimate. A workstation in the controls office can stay on the engineering network, with no route to the internet. Our page to buy an RTX PRO 5000 72 GB workstation lists the parts, and our comparison of two RTX PRO 5000 72 GB or one RTX PRO 6000 Max-Q weighs the alternative.
A two-card server. The entry server on our AI servers page has two RTX PRO 6000 Server Edition cards, two AMD EPYC processors, 384 GB of DDR5 ECC memory and two NVMe drives, at about 1.8 kW. It belongs in a server room and carries the PLC assistant beside the company assistant, document search or the service assistant for machine builders.
On site. Commissioning engineers work at the customer's plant, sometimes without a network connection. Generate the documentation of a machine's program before the visit and take it along; the model itself stays on the server or workstation in your office.
Setting it up for the IT team
- Offline installation. Driver, container runtime, engine and model weights can be installed without internet access; our guide to an air-gapped LLM server gives the steps.
- Serving. Run the model with vLLM. The Qwen3-Coder-Next card gives
--tensor-parallel-size 2with--enable-auto-tool-choiceand--tool-call-parser qwen3_coderfor a pair of cards. vLLM's--api-keyprotects only paths under /v1, /v2, /inference and /cohere (vLLM 0.32.0 security guide), so put an LLM gateway with keys and logging in front and keep the engine on an internal network. - The library index. Export your function-block library and naming rules as text, index them with an embedding model and keep the index under version control with the library.
- The compiler loop. Give the assistant a tool that compiles a block with your toolchain on a build machine and returns the messages. Without that tool, every draft waits for the engineer to compile it by hand.
- Software support. The RTX PRO Blackwell cards are compute capability 12.0; our guide to RTX PRO Blackwell software support lists the driver, CUDA and engine versions that support them.
- Measuring. Collect twenty typical tasks from your own projects with a reviewed solution, and rerun them after every model or prompt change; count compile errors and behaviour errors separately.
What we supply
You can buy this system from us: our team sizes the configuration to your workload and budget and replies within one business day. We build workstations with one or two RTX PRO 5000 72 GB and servers with RTX PRO 6000 Server Edition cards to order, assembled and tested before delivery, with the operating system, NVIDIA driver, CUDA and a container runtime installed on request, on one EU contract and invoice and with manufacturer warranty on every component handled through us; quantities and lead time are confirmed in writing with the quote. Our Private AI/ML service, with our engineering partner Vixen.UNO, sets up the model, the library index and the gateway; describe your controllers, tools and the code you want documented, and we propose a pilot.
FAQ
Can AI write PLC code in Structured Text?
Can I run an AI for PLC programming offline?
Which GPU do I need for a local PLC coding assistant?
Can AI document old PLC programs?
Should AI write safety PLC code?
How much does a local AI workstation for PLC programming cost?
We build RTX PRO 5000 workstations and RTX PRO 6000 Server Edition servers for controls teams and set up the model offline. Describe your task in a few sentences and our team will help. We reply within one business day. The first call is free.
Talk to an expertWe reply within one business day