PLC Programming SAPLC ProgrammingSOUTH AFRICA

brands · South Africa

CODESYS IEC 61131-3 language pick: when ladder beats ST

CODESYS supports all five IEC 61131-3 languages — LD, ST, FBD, IL, SFC. The pragmatic split: which language for which task. Walks the IDE step by step

For CODESYS CODESYS Development System V3.5.

CODESYS supports all five IEC 61131-3 languages — LD, ST, FBD, IL, SFC. The pragmatic split: which language for which task. This page is the working engineer's read — what the menu paths actually are in CODESYS Development System V3.5, what the keystrokes do, and the mistakes that bite once the program is on a real CPU. We program Soft-PLC + IEC 61131-3 hardware partners ourselves, daily; we are not a CODESYS sales channel.

Try the simulator →

What this is and when you need it

CODESYS supports all five IEC 61131-3 languages — LD, ST, FBD, IL, SFC. The pragmatic split: which language for which task. The walkthrough below is the same sequence we use when teaching this on the simulator. Every step names the exact menu path or keystroke; if a name has changed in your version of CODESYS Development System V3.5, it is called out. The simulator runs the same logic flow without the licence cost — ladder, FBD, and ST in a browser, with a virtual CPU you can download to.

Walkthrough

1. Pick LD (Ladder Diagram) for boolean logic

Ladder shines for discrete control: motor start-stop with seal-in latch, valve sequence with interlock, alarm aggregation with OR-gates. Electricians and panel-build technicians read ladder fluently — for any program a maintenance team needs to troubleshoot at 02:00, ladder wins. Don't write counter loops, math, or string handling in ladder — every rung becomes a subtraction-with-carry box and the page count explodes.

2. Pick ST (Structured Text) for math and loops

Structured Text is C-like: IF/THEN/ELSE, FOR/WHILE, CASE, function calls, expressions. ST is the right pick for: PID tuning math, recipe lookups via array indexing, string parsing for serial-port protocols, complex state machines (though SFC competes here). The downside: ST is harder to debug at runtime — the watch window shows variable values but doesn't visualise execution flow the way ladder does.

// ST example: tank fill with timeout
// IF Tank.Level < SetPoint AND NOT FillTimeout THEN
//   Tank.FillValve := TRUE;
//   FillTimer(IN := TRUE, PT := T#5M);
//   IF FillTimer.Q THEN
//     FillTimeout := TRUE;
//     Tank.FillValve := FALSE;
//   END_IF
// END_IF

3. Pick FBD (Function Block Diagram) for signal-flow

FBD is the right pick when the logic is signal-flow: chain a comparator, a deadband, a PID, an integrator, an output limiter. FBD reads top-to-bottom or left-to-right with explicit data flow lines. Process-control engineers familiar with DCS faceplate-builder tools take to FBD immediately. For pure boolean discrete control, FBD is uglier than ladder; for analogue chains, FBD is cleaner than ST.

4. Pick SFC (Sequential Function Chart) for state machines

SFC represents a sequence as steps and transitions. Each step contains an action (often written in ST or LD); each transition is a boolean condition that gates progression. SFC is the right pick for: batch processes, robot pick-and-place sequences, machine startup/shutdown procedures. The drawback: troubleshooting an SFC needs a graphical view, so the SFC editor must be available — debugging via remote text terminal is painful.

5. Skip IL (Instruction List)

Instruction List is assembler-like — LD, ST, AND, OR opcodes line by line. IL is supported by CODESYS for IEC 61131-3 compliance but the ecosystem has moved on. New code should not be written in IL; existing IL POUs migrating to V3.5 should be considered for rewrite to ST during the migration. IL is on a deprecation path in IEC 61131-3 Edition 4 (2024).

Common mistakes

  • Writing all logic in ST because the developer is more comfortable in C — the maintenance team reads ladder, and the 02:00 callout becomes a nightmare
  • Writing math-heavy logic in ladder with cascaded MOV and arithmetic blocks — page count explodes and the rung-by-rung debug is unworkable
  • Mixing SFC with deeply nested ST actions — the graphical SFC view becomes useless because each step hides 200 lines of ST that don't render
  • Choosing FBD for discrete bool logic out of personal preference — electricians struggle with FBD's data-flow lines for what they read instantly in ladder

Each of these mistakes shows up in real projects every week. The simulator catches the first three at compile time; the fourth one only surfaces on hardware, which is why we recommend running the cert packs against a real CPU once you have completed the curriculum modules.

How this fits the broader curriculum

CODESYS IEC 61131-3 language pick: when ladder beats ST is one of the building blocks. The full CODESYS curriculum on the simulator covers: programming-language fundamentals (ladder, FBD, ST), tag and variable scope, HMI tag binding, comms setup (Profinet / EtherNet/IP / Modbus depending on the platform), and the brownfield troubleshooting pathway. Each is its own module with worked examples and a portfolio piece. The cert packs at the Pro tier align to the ISA CCST exam content outline. Reference: isa.org.

For the platform-pick decision — when CODESYS is the right call versus a different brand — see the brand hub. For region-specific context on where CODESYS dominates the SA install base, see the relevant city pages under /brands/codesys/training-in-* and the sector pages under /industries.

Where this sits in a working week

A technician who has finished this module typically spends the next three to four working days running the same logic flow on hardware. The simulator's value is the dry run — getting the keystrokes and the IDE conventions into muscle memory before you sit down with a live CPU. The first time you build this on hardware, expect the IO mapping and the addressing conventions to slow you down for a session or two; the simulator's project tree mirrors the same shape so the transition is short.

The full CODESYS curriculum runs roughly 60 to 100 hours of focused practice. That breaks into bit logic and timers in the first 20 hours, FBs and structured data in the next 20, comms and HMI in the next 20, and a portfolio piece in the last block. Pace yourself — three or four hours per session, four sessions a week, and you finish in eight weeks. Most of our learners report that the bottleneck is not understanding the IDE, it is building reflex around the conventions: where CODESYS expects you to put state, how it scopes variables, what naming patterns the OEMs in the sector use.

Vendor reference

CODESYS's own documentation is the canonical reference once you are working on real hardware: CODESYS Online Help. The simulator covers the basics; the vendor docs cover everything specific to a hardware revision, a firmware update, or a CPU-specific quirk. Bookmark both. The IEC 61131-3 standard that governs all the CODESYS programming languages is at iec.ch.

What we don't claim

This site is not SAQA-registered, not MerSETA-accredited, and not an NQF-registered qualification provider. Our completion certificates are course-level only — they describe what you covered, not an NQF Level X qualification. The CCST cert from ISA is the portable industry credential we recommend; we are not an ISA cert delivery partner either, but our cert packs are CCST-aligned. The walkthrough above is brand-specific because CODESYS's tooling has its own conventions; do not assume the same menu paths exist in another brand's IDE.

How to start

You can be running codesys iec 61131-3 language pick: when ladder beats st in the simulator in 5 minutes. Free tier covers the basics, no card, no install. Once you are 20 minutes in you will know whether the platform fits how you learn. The full CODESYS curriculum is the Basic tier (USD 12 / month). The cert packs and portfolio export sit in the Pro tier (USD 29 / month). For institutional buyers — TVET colleges, private training providers, in-house engineering training departments — the bulk-licence option is the Teams tier, USD 199 per seat per year, minimum 5 seats. The training-centres page has the institutional pitch and the contact form.

Honest expectations on the local job market

Petrochem, mining, FMCG, automotive, and water-utility sectors all carry CODESYS install bases somewhere in their stack. Knowing the IDE conventions on this page does not get you a job by itself; it gets you past the first technical screen. The portfolio piece — a working program you built yourself, with a wiring track, a tag list, an HMI screen, and a short README explaining the design choices — is what lands the second interview. The simulator's portfolio export bundles all of that into a single folder you can hand a hiring engineer. Recruiters in this space skim the README first; if your design choices are coherent, they read the code.

Load-shedding has reshaped what gets built first in CODESYS programs across SA. Power-recovery patterns — controlled shutdown on UPS hold, state recovery from retentive memory, sequenced restart of motor groups — now belong in the same module as the basics. CODESYS IEC 61131-3 language pick: when ladder beats ST fits into that shape: every line of code you write needs to consider what state the controller is in when it powers up after a 2.5-hour cut, not just what state it is in when running. The simulator's restart-from-cut mode lets you exercise this without bricking real hardware.

Start the free tier →

By PLC Programming SA · Last updated 2026-05-11