Lessons in this course (10)

3. IEC 61131-3 languages and ladder logic basics

Intermediate★ Must knowLesson 3 of 10
LanguageStyleBest for
LD — Ladder DiagramGraphical relay logicDiscrete on/off logic, electricians can read it
FBD — Function Block DiagramGraphical blocksProcess control, signal flow
ST — Structured TextPascal-like textCalculations, loops, data handling
SFC — Sequential Function ChartSteps and transitionsSequences (batch, machine cycles)
IL — Instruction ListAssembly-likeDeprecated in the 3rd edition (2013)

Classic start/stop (seal-in) circuit:

text
 |  Start      Stop       Overload          Motor  |
 |---| |---+---|/|--------|/|---------------( )----|
 |         |                                       |
 |  Motor  |                                       |
 |---| |---+                                       |
  • | | normally open contact (true when the bit is 1), |/| normally closed contact (true when the bit is 0), ( ) output coil.
  • Pressing Start energises Motor; the parallel Motor contact "seals in" so it stays on after Start is released; Stop (wired NC in the field for fail-safety) breaks the rung.

Same logic in Structured Text:

pascal
Motor := (Start OR Motor) AND NOT Stop AND NOT Overload;

Other instructions: set/reset (latch/unlatch), rising/falling edge (R_TRIG, F_TRIG), compare, move, math, jump/subroutine calls.