Ladder logic won because a millwright with no software background could look at a rung, see a broken contact, and know exactly which limit switch to check. That’s not nostalgia — it’s the entire reason relay ladder logic survived the transition from actual relays to microprocessors in the first place. Structured text is winning ground now for a different and much less sentimental reason: the tools that write it have gotten good, and the machines it needs to control have gotten more repetitive and more parameterized than ladder was ever built to express cleanly.
TIA Portal, Studio 5000, and TwinCAT 3 have all been pushing object-oriented Program Organization Units — instantiable function blocks, method calls, inheritance-style structuring — for years. What’s new is that the AI code-assist features now shipping in these platforms generate structured text with far more reliability than they generate ladder rungs. That’s not a coincidence. ST is text. Language models are extraordinarily good at generating structured, syntactically constrained text and noticeably worse at reasoning about the two-dimensional rung geometry, implicit scan-order dependencies, and branch topology that make ladder ladder. So when an integrator asks a copilot to draft a state machine for a bagging line, it comes back as a clean CASE statement in ST, not a rung diagram. That’s quietly tilting the default language choice on new machine builds, and it’s worth taking seriously rather than either ignoring it or overcorrecting into converting everything you own.
The real triggers, not the hype ones
The case for structured text and OOP-style function blocks has always been legitimate in specific situations. What’s changed is that AI tooling lowers the authoring cost, which shifts the break-even point. Here’s where the migration argument actually holds up.
You build the same machine more than once
If you’re a machine builder shipping the same conveyor cell, palletizer, or blow-molder platform to multiple customers with minor variations, ladder logic punishes you every time you touch a copy-pasted rung group across twenty projects. A properly instantiated function block — parameterized, with private internal state, exposed only through a defined interface — lets you fix a bug once in the FB definition and have every instance inherit the fix on next compile. This is the single strongest, least controversial argument for OOP-style ST in the IEC 61131-3 world, and it was true a decade before AI code-assist existed. AI tooling just makes authoring the FB library faster and lowers the barrier for a two-person integration shop to build one properly instead of copy-pasting.
Recipe-driven and high-mix equipment
Machines that run many products off configurable data — packaging lines with dozens of SKUs, coating lines with recipe-driven setpoints, anything ISA-88 batch-flavored — benefit from structured, array-and-struct-based recipe management that ladder simply isn’t good at expressing. Doing recipe math and table lookups in rungs means MOV instruction after MOV instruction with indirect addressing that’s miserable to audit. ST handles this natively with loops, arrays of structs, and functions that operate on data instead of on individual contacts.
Genuinely complex sequencing and math
Multi-axis motion coordination, PID cascades with adaptive gain scheduling, anything with real branching logic and nested conditionals — ST expresses this more compactly and, done well, more legibly than the ladder equivalent, which tends to sprawl into rung counts nobody wants to page through during commissioning.
Where it just adds risk
None of that means you should start converting stable ladder programs wholesale, and here’s where I’d push back on the enthusiasm building around AI-assisted ST generation.
If your machine is simple, discrete, and already running reliably, converting working ladder to ST to chase a trend creates commissioning risk with no operational upside. The bigger issue is your maintenance bench. Most plant electricians and controls techs came up on ladder logic; it maps to the physical world they’re troubleshooting with a meter in hand. Drop a beautifully architected OOP function block library in front of a night-shift tech at 2 a.m. with a line down, and if they can’t read ST fluently, you’ve traded a maintainability problem for an availability problem — which is strictly worse.
AI-generated ST is also not free of risk just because it compiles cleanly. Code-assist tools are good at producing syntactically valid, plausible-looking structured text; they are not good at knowing your machine’s failure modes, your safety interlocks, or why a previous engineer put a two-second delay in front of a valve command. Treat generated ST exactly like code from a junior programmer: review every line against the actual sequence of operations, verify it against a written functional spec, and never let it near a safety-rated routine without full validation. IEC 61131-3 doesn’t get you out of IEC 61508 or ISO 13849 obligations.
A migration pattern that doesn’t strand your maintenance techs
The pattern that actually works in practice is a hybrid, not a wholesale platform switch: keep ladder as the outer shell and push ST inward, into the parts that benefit from it.
- Ladder as the “front door.” Machine states, permissives, interlocks, and anything a tech needs to troubleshoot with an eye and a meter stay in ladder rungs at the top level. This is what shows up on the operator HMI’s diagnostic screen and what techs open first.
- ST inside function blocks, called from ladder. Recipe math, sequencing logic, and repeated machine-instance behavior live inside FBs written in ST, invoked from a ladder rung. The tech sees “Call FB_FillSequence” as a single rung; they don’t need to read the FB internals to know it’s running, only to know it’s called and what its inputs/outputs mean.
- Document the interface, not just the code. Every FB gets a plain-language description of its inputs, outputs, and fault outputs, sitting right next to the code in the platform’s native documentation fields. That’s what a tech actually reads during troubleshooting — not the CASE statement.
- Version and interface discipline for the FB library. Treat exposed inputs/outputs as a stable contract. Add new parameters at the end, don’t reorder or repurpose existing ones, and keep internal (private) variables truly private so downstream logic never depends on FB internals that might change.
Building function blocks that survive the next platform migration
PLC platforms get replaced — firmware upgrades break things, and full platform migrations (Studio 5000 to TwinCAT, or a major TIA Portal version jump) happen over a machine’s lifetime more often than anyone plans for. Function blocks that survive that transition share a few traits: they avoid vendor-specific instructions where a standard IEC 61131-3 equivalent exists, they don’t rely on platform-specific timing quirks or scan-cycle assumptions, and they keep hardware I/O mapping outside the FB itself, passed in as parameters rather than hardcoded tag references. An FB that reads a physical input directly is married to that platform’s addressing scheme; one that receives a BOOL parameter from the calling routine is portable.
The practical test: could you drop this FB’s ST code into a different vendor’s IDE, remap the I/O calls, and have it compile with minimal edits? If the answer is no because it’s full of platform-specific system function calls, you’ve built something clever that will become next decade’s legacy problem — the exact trap ladder logic itself has been in for the last twenty years.
What to actually do in 2026
Don’t chase the language. Chase the trigger. If you’re building machine platforms you’ll replicate, running recipe-driven equipment, or find yourself already reaching for AI code-assist because ladder is fighting you on a sequencing problem, structured text and properly instantiated function blocks are worth the investment — and the AI tooling now makes that investment cheaper than it’s ever been. If you’re maintaining stable, simple, discrete machines with a maintenance team that reads ladder and only ladder, converting for its own sake is a solution looking for a problem. The shops that get this right in the next few years won’t be the ones who went all-in on ST. They’ll be the ones who knew exactly which parts of their codebase actually needed it.
This article was written with the assistance of artificial intelligence. While we aim for accuracy, the information may be incomplete, out of date, or incorrect, and should be independently verified before you rely on it for any decision. It is provided for general information only and does not constitute professional advice.
