Lessons · Industrial control · set and reset bits
Set and reset
(L Name) turns a bit on and leaves it; (U Name) turns it off. Nothing else changes it.
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
Alarms that must persist, modes selected once, faults cleared by an operator.
How to think about it
What sets it, and what clears it? One rung latches, another unlatches. Rung order decides who wins if both fire in one scan: the later one.
Worked example
[Trip] (L Alarm)Fault sets it.
[Ack] [/Trip] (U Alarm)Acknowledge clears it, only once the fault is gone.
Your turn
Unlatch on Reset.
[Reset] ( Mode)
Run a rung and watch the scan
The trap
A latched bit survives a power cycle on many PLCs. Decide deliberately what a restart should do.
Practise set and reset bits on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.