PLC-Course

Sprint 3 Cheat Sheet — Ladder & FBD

🪜 Ladder Symbols

 ─┤ ├─    Normally Open contact   (passes power when bit = 1)
 ─┤/├─    Normally Closed contact (passes power when bit = 0)
 ─( )─    Output coil             (energizes when rung is true)
 ─(/)─    Negated output coil
 ─(L)─    Latch coil              (sets and holds)
 ─(U)─    Unlatch coil            (resets)

🔣 The 7 Logic Gates as Ladder

Gate Ladder Boolean
AND Two NO contacts in series Y = A · B
OR Two NO contacts in parallel Y = A + B
NOT One NC contact Y = ¬A
NAND Two NC contacts in parallel Y = ¬(A · B)
NOR Two NC contacts in series Y = ¬(A + B)
XOR (A NO + B NC) parallel with (A NC + B NO) Y = A ⊕ B
XNOR (A NO + B NO) parallel with (A NC + B NC) Y = ¬(A ⊕ B)

🔒 Latching — Two Patterns

Seal-in latch (most common):

   START      STOP
 ─┤ ├──┬──┤/├──────( MOTOR )
       │
   MOTOR
 ─┤ ├──┘

SR latch (set/reset coils):

   START
 ─┤ ├────────( L MOTOR )

   STOP
 ─┤ ├────────( U MOTOR )

⚠️ STOP must be NO here, not NC — the unlatch coil only fires when the rung is true.

🔌 Power Flow Convention

This is a useful fiction. Internally the PLC just evaluates Boolean expressions — there is no electrical current in software.

🐛 Top 5 Ladder Bugs

  1. Double-coiling — same output written from two rungs. Last rung wins.
  2. Order-dependence — relying on rung A being evaluated before rung B for correctness.
  3. Forgotten NC for STOP — using NO STOP means a broken wire prevents stopping (huge safety bug).
  4. Latch trap — set-coil with no clear unlatch path. Output stuck on forever.
  5. Race with one-shot — pulse generated by edge detection but consumed in same scan.

🧱 Function Block Diagram (FBD)

Same logic, drawn as wired blocks instead of rungs:

   A ───┐
        ├─[ AND ]─── Y
   B ───┘

When to prefer FBD over LD:

When to prefer LD over FBD:

🧪 The Boolean → Ladder Translation Recipe

  1. Write the spec as a sentence: “Motor runs when Start is pressed AND guard is closed AND no fault.”
  2. Identify inputs, outputs, conditions.
  3. Write the Boolean: MOTOR = START · GUARD · ¬FAULT
  4. Convert each AND to series, each OR to parallel, each ¬ to NC contact.
  5. Test mentally with all input combinations.