6 min read

The Last Code we'll write for Machines

Industrial automation has run on hand-written code for fifty years. The next generation of AI doesn't write better code. It replaces the code entirely.
The Last Code we'll write for Machines

Walk into any factory, distribution center, or processing plant right now and the brain of the operation is almost certainly the same kind of machine it was thirty years ago. A programmable logic controller, or PLC, sitting in a beige enclosure, running a program written in a language called ladder logic, designed in the 1970s to look like the relay schematics electricians already knew how to read.

That choice was deliberate, and it was brilliant. Industrial automation needed a programming language a maintenance technician could troubleshoot at three in the morning during an outage, with a wiring diagram in one hand and a flashlight in the other. Ladder logic delivered that. Look at the rung, find the green line indicating power flow, follow it to the broken contact, replace the part. Decades of plant uptime were built on the simplicity of that single design choice.

Today, ladder logic still represents 80 to 90% of the installed automation code base in North America. The architecture underneath it is changing fast.

What a PLC actually is, and why it stuck

A PLC is a purpose-built industrial computer designed for one job: run a control program in a deterministic loop, scanning inputs, executing logic, and writing outputs, usually within a few milliseconds, every cycle, forever. The hardware is rugged. The software is constrained. The entire stack is engineered to fail safely.

The deterministic loop is non-negotiable. A delayed signal to an emergency stop can end a career, hurt a person, or destroy a million dollars of equipment. The PLC's job is not to be smart. It's to be predictable, every cycle, under every condition, for twenty years.

Ladder logic was the language built around that job. Visual, scan-based, friendly to the maintenance electrician, and constrained enough that you could not easily write something dangerous. For most of the last forty years, that was exactly the right tradeoff.

Why structured text is taking over

The constraints that made ladder logic perfect for relay-style boolean logic become limitations the moment your machine has to do anything mathematically complex. PID loops with adaptive tuning. Recipe-driven batch processes. Communication with databases, web services, and modern protocols like OPC UA. Anything involving arrays, loops, or string manipulation. All of it is awkward in ladder, and elegant in structured text.

Structured text, or ST, is one of the five languages defined under the IEC 61131-3 international standard for industrial control programming. If you have ever written code in Pascal or C, ST will look familiar.

That's a complete control routine. Read it once and it tells you exactly what the machine will do.

Younger engineers entering the field came up on Python and JavaScript, not on relay schematics. Modern industrial projects increasingly need to integrate with cloud systems, databases, and external APIs, all of which are easier to handle in text. Code review, version control, and continuous integration workflows that have been standard in software engineering for two decades are finally landing in the controls world, and they need text, not pictures, to function.

Modern industrial code increasingly uses ladder for what ladder is best at, the boolean I/O at the edges, and structured text for everything else. The two coexist inside the same project. The ladder rungs run the safety interlocks. The structured text runs the math.

The IPC takes over the brain

Underneath the language shift is an architectural one. The hardware running the control logic is changing too.

An industrial PC, or IPC, is what it sounds like: a ruggedized server that runs the control program as software, on top of a real-time operating system, on standard x86 hardware. The same processor architecture that runs your laptop, hardened for vibration, dust, temperature, and the years of continuous operation an industrial environment demands.

Hardware agnosticism. A traditional PLC locks you into a single vendor's ecosystem. Processor, I/O modules, programming software, support contract, all from the same company at premium prices. An IPC running a runtime like CODESYS or TwinCAT runs on hardware from any vendor that meets the spec.

Compute capacity. A modern IPC can run real-time control alongside vision processing, machine learning inference, edge analytics, and historian functions, all on the same box. The traditional PLC could do exactly one of those things, and not very fast.

Software pipelines. IPCs run modern operating systems, which means they plug into the same continuous integration and deployment (CI/CD) pipelines that modern software companies use. Push a code update to a fleet of machines from a central repository. Roll back if something breaks. Version control everything.

GPU access. IPCs can host NVIDIA GPUs, which means computer vision, defect detection, and reinforcement learning models can run directly on the machine controlling the line. The PLC was never going to do this. The IPC was designed for it.

The transition is well underway. Most new automation projects in the last few years specify IPCs for any application beyond the simplest boolean logic. The traditional PLC is not dead, but it has become the cheaper, simpler, lower-tier option, not the default.

What replaces the engineer at the keyboard

Here's where the next decade gets interesting.

At Hannover Messe 2026, Siemens unveiled the Eigen Engineering Agent, an AI system that connects to its TIA Portal programming environment and autonomously generates, debugs, and documents PLC code. Schneider Electric and Rockwell have shipped similar tools. PLC Copilot is a third-party platform that lets engineers describe a control sequence in plain English and get deterministic, vendor-specific code in return. The industrial AI agents market sits at $6.88 billion in 2026 and is projected to reach $90.8 billion within the decade.

That's the near-term story. The engineer's job moves from writing code to specifying intent, reviewing output, and validating safety. Useful, but still incremental. There is still code. There is still a PLC or IPC running it. The AI is just a faster way to get there.

The deeper shift comes when the code goes away.

When the model becomes the control loop

Look another five to ten years out and the architecture changes shape entirely. A foundational model trained on industrial control, given the functional description of a machine, the schematics, the safety envelope, and the operational targets, will not write code. It will run the machine.

The model itself becomes the control loop. Sensor values stream in. Motor commands stream out. Decisions made every few milliseconds, the same way a PLC scan cycle works today, except the logic is not compiled lines of structured text. The logic is a model evaluating inputs and choosing actions, learning from what works, adapting to new equipment by description rather than by hand-mapping every signal.

No middle layer. No translator turning intent into code, then code into machine instructions. The AI talks to the machine directly.

That sounds like science fiction, but the building blocks are already in place. NVIDIA's industrial robotics platforms run reinforcement learning policies as the primary controller for entire workcells. Foundation models for robotics, like RT-2 and its successors, take natural language commands and produce motor outputs in real time. The same approach scaled up to a packaging line, a sortation system, or a process plant is engineering work, not invention.

The hard problems are not technical. Determinism: can the model guarantee a response inside a fixed time window, every time, under every condition? Safety certification: will a regulator and an insurance carrier sign off on a model that cannot fully explain its own decisions? Failure modes: when the AI makes a wrong call, can the system fail safely? These are real questions, and they will not be solved by demos. The same engineering discipline that made ladder logic safe will eventually make AI as the controller safe.

The continuity inside the change

It is easy to read this arc as a story of obsolescence. Ladder logic giving way to structured text giving way to AI giving way to whatever comes next. But there is something steadier and more important running underneath it.

Each layer in this stack exists because the last one earned it. Ladder logic earned its place by making automation troubleshootable for a workforce that did not have software backgrounds. Structured text earned its place by handling the math and integration that ladder could not. IPCs earned their place by collapsing five appliances into one box and opening the door to modern software practices. AI as the control loop will earn its place when it can run a machine more safely and more efficiently than any program a human can write, and when the regulators trust it.

The goal of every layer has been the same: keep the machine running, keep the people safe, keep the throughput up. The tools change. The job does not.

The engineers who navigate the next decade well will be the ones who hold both ends at once. They will know what ladder logic was for, what AI controllers are for, and how to translate between them on the floor where the work actually happens.

That bridge, built one layer at a time, is where industrial automation has always actually lived.