Lessons · Industrial control · the scan cycle
Top to bottom, every scan
Rungs solve in order; a coil written on rung 1 is seen by rung 2 in the same scan, but rung 1 sees rung 2's coil from the previous scan.
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
One-scan delays are timing bugs: a counter that double-counts, an interlock a scan late.
How to think about it
Ask for each rung: does it read a coil written above (this scan) or below (last scan)? Place memory rungs deliberately.
Worked example
[Sensor] (Seen)Written first.
[Seen] (Act)Reads this scan's Seen: Act follows Sensor in the same scan.
Your turn
Make Act react in the same scan.
[Sensor] (Seen) [] (Act)
Run a rung and watch the scan
The trap
Assuming everything happens at once. It does not; the order is the program.
Practise the scan cycle on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.