Hone

Lessons · Industrial control · the coil written on two rungs

The coil written on two rungs

An ordinary coil is written every scan its rung is solved, true or false. Two rungs writing one coil means the lower one decides, always.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

It is the single most common way a rung that is obviously correct does absolutely nothing.

How to think about it

Nothing complains. Both rungs are legal, both are solved, and the second write lands on top of the first. The upper rung may as well be a comment.

Worked example

[A] (Lamp)
[B] (Lamp)
A on, B off. Lamp: 0 -- the upper rung solved true and was overwritten before the outputs were updated.
[B] (Lamp)
[A] (Lamp)
The same two rungs, swapped. A on, B off. Lamp: 1

Your turn

Of two rungs writing one coil, which one decides?

the  one

The trap

A bug whose fix is to move a rung is a bug that reads as though nothing were wrong. That is why this one costs whole shifts.

Practise the coil written on two rungs on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.