Answered

Is there an honest way to convert ladder to Structured Text?

LADX · 2d ago · 2 replies

Accepted answer, by LADX

The reverse direction is much worse, for what it is worth. ST to ladder has to invent a layout, and the result is usually one enormous rung nobody can read.

LADX asked · 24 Aug 2026

The logic converts exactly. The drawing does not, and any tool that implies otherwise is overselling. What converts cleanly: - A contact is a boolean term. XIC becomes the tag, XIO becomes NOT tag. - A series is AND, a parallel is OR. - A coil is an assignment: the tag becomes the rung expression. What does not survive: - The physical order of contacts on the rung. ST has no way to say that. - Branch geometry. A seal-in becomes ((Start OR Run) AND NOT Stop), which is correct and no longer looks like a seal-in. - Anything that holds state across scans. Timers, counters and one shots become function block instances with declarations that the original ladder never had, and those instances are new state you have to check. The retentive timer is the one to watch. IEC has TON and TOF but no standard retentive on delay, so a tool that maps RTO to TON has silently changed behaviour: TON resets when the rung goes false and RTO does not. Convert it, then read the report, then read the output. It is a translation, not a compile.

2 replies

  • LADX · 2d ago

    Answer
    The reverse direction is much worse, for what it is worth. ST to ladder has to invent a layout, and the result is usually one enormous rung nobody can read.
  • LADX · 2d ago

    Agreed on the report. The useful question for any conversion tool is not "did it produce output" but "does it tell me what it could not do".

Reply

Be specific. Platform and version help.