Section 04 · Practice Questions

Ladder Logic Programming Basics

Eight questions on the everyday craft of ladder programming — XOR in rungs, POS-form construction, translating between relay diagrams and ladder, push-on/push-off lamp control by two different methods, debugging a rung, and converting ladder back into a logic-gate circuit.

8Questions
8Worked Solutions
All practice sections

Sketch each rung on paper first — series for AND, parallel for OR, NC contacts for complements — then open the worked solution to compare.

Q1

The three-variable XOR in ladder form

Develop a ladder program that realises the three-variable XOR function, using the most efficient implementation you can.

ShowHide worked solution

The three-variable XOR cannot be simplified further — its 1s sit on an isolated checkerboard with no adjacent groups on the K-map. The minimum SOP form keeps all four 3-input AND terms:

F = A′B′C + A′BC′ + AB′C′ + ABC
Ladder program
|---[/A]---[/B]---[ C]------+--------( F )---|
|                           |
|---[/A]---[ B]---[/C]------+
|                           |
|---[ A]---[/B]---[/C]------+
|                           |
|---[ A]---[ B]---[ C]------+

Four parallel rungs — each a 3-contact AND in the right NO/NC pattern — feeding one output coil.

Ladder has no native XOR contact, so the four-rung canonical SOP is the cleanest implementation. A two-rung version using cascaded 2-input XORs would need extra intermediate coils and ends up no shorter.

Final AnswerFour parallel rungs (each rung is one 3-input AND of the appropriate NO/NC contacts) feeding a single output coil F.
Q2

Implementing Z = A·B′·C in POS form

Using POS-form logic, design and implement the Boolean function Z = A · B′ · C.

ShowHide worked solution

The SOP form Z = A·B′·C has only one minterm — m5 in the 3-variable space — so its full maxterm POS expansion would have seven sum-terms, which is not useful. The practical minimum POS expresses Z as three single-literal sum terms: Z = (A)(B′)(C).

In POS thinking, every contact on the rung represents one sum-term that must be true for the output to be true. A NO contact on A enforces (A) = 1; an NC contact on B enforces (B′) = 1; and a NO contact on C enforces (C) = 1.

Ladder program
|---[ A ]---[/B]---[ C ]---------( Z )---|

A single rung — three series contacts, each one a POS sum-term that must be true.

Final AnswerSingle rung — series A (NO), B (NC), C (NO) into one coil Z. The SOP and POS minimum forms happen to coincide here.
Q3

Translating a relay AND to a PLC ladder

Given the relay diagram of a two-input AND circuit, produce the equivalent PLC ladder program. The solution must occupy no more than two rungs.

ShowHide worked solution

A two-input AND has output Y = A · B. A single rung with two series contacts is enough — if the design wants to preserve the relay drawing’s rung-count, a second rung can drive a status lamp from the AND output.

Ladder program
|---[ A ]---[ B ]---------( Y )----------|

|---[ Y ]---------------( STATUS_LAMP )--|   (optional)

One rung is enough: two series contacts A and B drive output Y.

Final AnswerOne rung: two series contacts A and B drive coil Y. Y = A·B.
Q4

A simplified single-rung ladder from a problem statement

From a supplied problem statement, write a simplified ladder-logic solution that, where possible, fits onto a single rung. Practice variant — invent your own short scenario with up to three inputs and one output and implement it minimally on a single rung.

ShowHide worked solution

Practice scenario

A garage door (Y1) opens when the entry button (X0) is pressed, the safety beam (X1) is unobstructed (NC), and the manual override key (X2) is in the AUTO position.

Y1 = X0 · X1 · X2
Ladder program
|---[ X0 ]---[/X1]---[ X2 ]----------( Y1 )---|

A single rung — series-combine the contacts in their correct NO/NC form, drive the output coil.

The safety beam uses an NC contact because the obstructed state must interrupt the door; in the unobstructed state the contact stays closed and the rung completes.

Final AnswerSimplified ladder fits on one rung — series-combine the contacts in their correct NO/NC form, drive the output coil.
Q5

Push-on / push-off lamp — Boolean instructions only

Design a ladder program using only Boolean-logic instructions for a push-on / push-off (odd/even press) lamp control: an odd number of presses turns the lamp ON, an even number turns it OFF. Only a single Normally Open push-button is provided, and releasing the button has no effect.

ShowHide worked solution

With OSR (edge-detect) instructions forbidden, two internal memory bits are needed. M1 arms the OFF→ON transition while X is held; on release the lamp Y commits ON. M2 arms the ON→OFF transition; on release the lamp Y unlatches.

Ladder program
Rung 1 — arm M1 while X is held and Y is OFF:
|---[ X  ]---[/Y]---+---( M1 )---|
|                   |
|---[ M1 ]---[ X ]--+

Rung 2 — when X is released with M1 latched, Y turns ON (sealed):
|---[ M1 ]---[/X]---+---( Y  )---|
|                   |
|---[ Y  ]----------+

Rung 3 — arm M2 while X is held and Y is ON:
|---[ X  ]---[ Y ]---+---( M2 )---|
|                    |
|---[ M2 ]---[ X ]---+

Rung 4 — when X is released with M2 latched, Y is reset:
|---[ M2 ]---[/X]---[ Y ]----( RST Y )---|

Two memory bits, each arming on press and committing on release — strictly Boolean instructions.

Final AnswerUsing only Boolean instructions, two internal latches are needed — M1 for the OFF→ON transition and M2 for the ON→OFF — each armed while the button is held and committing on release.
Q6

Push-on / push-off lamp — counter only

Re-solve the push-on / push-off problem using a counter only, without any Boolean shortcuts.

ShowHide worked solution

Use a single up-counter C5 with preset 2. Every press of the button X increments the accumulator. The lamp Y is ON whenever the accumulator equals 1 (odd press). When the count reaches 2, the DN bit fires and the counter auto-resets — pattern repeats indefinitely.

Ladder program
Rung 1: |---[ X ]----------(CTU C5, PRE = 2)---|
Rung 2: |---[ C5.DN ]------(RES C5)------------|
Rung 3: |---[ C5.ACC = 1 ]---------( Y )-------|

First press → ACC = 1 → Y ON; second press → ACC = 2 → DN fires, counter resets, Y OFF.

Final AnswerOne CTU with preset 2: lamp ON when ACC = 1, counter auto-resets on DN. Far cleaner than the Boolean-only version.
Q7

Debugging a faulty motor-start rung

A PLC ladder program is supplied. Locate the fault, correct it, and write the simplified Boolean equation that corresponds to the corrected ladder.

ShowHide worked solution

Sample faulty rung

Faulty ladder
|---[ STOP ]---[ START ]---+---( M )---|   ← STOP is NO — not fail-safe
|                          |
|---[  M   ]---------------+

The fault. A Stop button must always be wired Normally Closed so that a broken wire or loose connection stops the motor (fail-safe). With a NO contact on STOP, the rung evaluates as 0 with no press, so the motor can never start in the first place.

Corrected rung

Corrected ladder
|---[/STOP]---+----[ START ]---+--------( M )---|
|             |                |
|             |---[  M   ]-----+
M = (¬STOP) · (START + M)
Final AnswerReplace the NO contact on STOP with NC. The corrected rung is the textbook 3-wire seal-in: M = (¬STOP)·(START + M).
Q8

Translating a ladder program into a gate circuit

Translate a supplied PLC ladder program into the equivalent logic-gate circuit representation.

ShowHide worked solution

Sample ladder

Ladder program
|---[ A ]---+----[ C ]---------( Y )---|
|           |
|---[/B]----+

Translation rules

  • Series contacts → AND gate.
  • Parallel branches → OR gate.
  • NC contact → input through a NOT gate.
  • Output coil → the network’s output.

Applying these to the sample rung — A in parallel with B (via NOT), the result then in series with C — gives:

Y = (A + B′) · C
Final AnswerSeries → AND, parallel → OR, NC → NOT, coil → output. The example yields Y = (A + B′)·C.