Hone

Lessons · Industrial control · finding a second writer

Finding a second writer

Cross-reference the tag: every rung that touches it, and which of those write it. Two writes is your answer.

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

Reading will not find it. The second rung is usually pages away and was added by somebody who could not see the whole program at once.

How to think about it

The column that matters is read against write. A tag read on twenty rungs is normal. Written on two is the bug, and it is the column people skim past.

Worked example

[A] (Lamp)
[B] (Lamp)
Two writes of Lamp. A on, B off. Lamp: 0 -- exactly what the cross-reference would have told you before you ran it.

Your turn

Which references make a double coil?

the 

The trap

Run the cross-reference BEFORE you add a rung that writes an output, not after the machine misbehaves. That is the whole habit.

Practise finding a second writer on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.