Free practice · 5–10 minutes
Read it. Predict it. Trace it.
Read the inputs, choose 0 or 1, then check the next scan. See why the result changed, not just whether you were right.
3 circuits · 13 decisions · No account or hardware needed
Changing circuits starts a fresh trace. Results stay in this tab; download your trace before switching.
Your scan trace
Only checked scans appear here. Memory is updated after each check.
| Scan | Inputs | Memory before | Your prediction | Result |
|---|
Paper version and worked answers
1. Series contacts
MotorCmd := Permit AND Start; For (Permit, Start) values (0,1), (1,1), (1,0), predict MotorCmd before checking.
Answers: 0, 1, 0. Both conditions must be true. This circuit has no memory.
2. Seal-in
Run := Permit AND NOT Stop AND (Start OR Run); Begin with Run=0. Try these (Permit, Stop, Start) inputs: (1,0,1), (1,0,0), (1,1,1), (1,0,1), (0,0,0).
Answers: 1, 1, 0, 1, 0. Run holds after Start is released. Stop overrides Start. Releasing Stop while Start is still held restarts this basic circuit; it does not require a new button press. Losing Permit clears Run.
3. Rising edge
Start with Previous=0 and Count=0. Each scan: Pulse := Sensor AND NOT Previous; then increment Count only if Pulse is true; finally set Previous := Sensor;. Use Sensor values 0,1,1,0,1.
Pulse: 0,1,0,0,1. Count: 0,1,1,1,2. A held-high signal produces one pulse, not one pulse on every scan. This simplified model assumes one evaluation per scan and memory that persists between evaluations.
What these examples model
These exercises evaluate Boolean program logic once per simulated scan. 0 means FALSE; 1 means TRUE. Memory starts at 0 when a circuit is restarted. Stop=1 means an ordinary stop request. Permit is an ordinary logical condition. The sketches show software contacts, not physical wiring.
The seal-in circuit deliberately exposes the held-start restart behavior. The rising-edge exercise uses explicit Boolean memory to explain the concept; it is not a complete vendor-specific PLC program. Real CPU scheduling, initialization, I/O updates and safety requirements need separate treatment.
For the instruction behavior behind the edge example, see Siemens R_TRIG documentation.
Make the reasoning stick.
After a circuit, close the feedback and explain one result aloud. Then use the matching written lesson for a harder variation.
Scan cycles and Boolean logic →
Start, stop and seal-in →
Edges and part counting →