
📢 Fresh Content: PLC Troubleshooting Tips That Work Across Any Platform | Click to read on PLCBlog!
One push button: press → lamp ON, press again → lamp OFF. Sounds trivial, defeats most beginners. The trick is a rising-edge contact plus a snapshot of the lamp's state taken BEFORE you change it.
Your goal
The snapshot-then-act pattern you'll reuse it constantly.
I/O for this exercise
| Inputs | |
| Btn | Toggle push button |
| Outputs | |
| Lamp | Lamp |
| Internal coils | |
| WasOn | Snapshot: lamp state at scan start |