Structured Text for people who think in ladder
The translation is mostly mechanical, and four constructs cover the majority of real code.
By the LADX engineering team, first published 23 August 2026
Short answer
Map the concepts directly: a rung becomes an assignment guarded by a boolean expression, a series of contacts becomes AND, a parallel branch becomes OR in brackets, and a latch becomes an IF block rather than an assignment. Timers become function block instances that must be declared, which is the one genuinely new idea.
If you can read a rung, you can read Structured Text after about an hour. The mapping is close to mechanical.
A rung is an assignment
XIC(Start) XIO(Stop) OTE(Motor) becomes Motor := Start AND NOT Stop;.
Series is AND. A normally-closed contact is NOT. The coil is the assignment target.
A branch is OR, and the brackets matter
A seal-in becomes Motor := (Start OR Motor) AND NOT Stop;.
Leave the brackets out and AND binds tighter, producing Start OR (Motor AND NOT Stop), which latches on and never releases. This is the single most common ST bug written by ladder programmers.A latch is an IF, not an assignment
OTL(Motor) becomes IF Condition THEN Motor := TRUE; END_IF;.
Writing Motor := Condition; instead clears the bit whenever the condition goes false, which is the opposite of a latch.
Timers need declaring
This is the genuinely new idea. In ladder the timer instance was created for you. In ST you declare Warmup : TON; and then call Warmup(IN := Heater_On, PT := T#5s);, reading Warmup.Q for the done bit.
Forgetting the declaration is the first compile error every ladder programmer meets.
The quickest way through it is to meet it on purpose. The LADV lab opens a motor station with its inputs and outputs already declared in Structured Text; call a timer you have not declared and the compiler names it and the line, before anything runs.
Going the other way with an existing program? Converting ladder logic to Structured Text covers the rules and the rungs that break.
Sources and further reading
- Rockwell Logix 5000 Structured Text programming manualliterature.rockwellautomation.com
- Structured Text (Wikipedia)en.wikipedia.org
Common questions
- What is the Structured Text equivalent of a seal-in circuit?
- Motor := (Start OR Motor) AND NOT Stop; The brackets are essential. Without them, AND binds tighter than OR, so the expression becomes Start OR (Motor AND NOT Stop), which latches on and never releases.
- How do timers work in Structured Text?
- As function block instances. You declare an instance, for example MyTimer : TON;, then call it with MyTimer(IN := Condition, PT := T#5s); and read MyTimer.Q for the done bit. The declaration is the part ladder programmers forget, because ladder created the instance implicitly.
Keep reading
- Languages
Structured Text examples: 12 complete IEC 61131-3 programs you can run
Twelve complete Structured Text programs from a seal-in to a two-task program, each with its purpose, what to watch when it runs and the classic mistake.
- Languages
What does IEC 61131-3 compliant mean? Editions, statements and PLCopen
What an IEC 61131-3 compliance statement is, how the editions and PLCopen levels differ, why two compliant products still behave differently, and how to read a vendor's table.
- Languages
Ladder logic to Structured Text: converters, rules and pitfalls
How a rung becomes Structured Text, the rules a converter must follow for timers, edges and latches, and the rungs that convert wrongly unless you test them.