Hone

Lessons · Industrial control · the double coil trap

One coil, two rungs, one winner

If two rungs write the same coil, the last one each scan wins; the first is overwritten before outputs update.

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

The classic novice fault: an alarm that only sometimes fires.

How to think about it

Does any coil have two rungs? Every coil gets exactly one rung. Combine conditions with a branch (OR) or series (AND) instead.

Worked example

{ [HighTemp] | [LowPressure] } (Alarm)
One rung, both conditions.

Your turn

Merge two writers into one rung.

{ [A]  [B] } (Out)

The trap

It 'works' in testing when only the last condition is exercised.

Next in Industrial control

Every Industrial control lesson on one page

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