Concept Flow - Washing machine control sequence
Start
Fill Water
Wash Cycle
Drain Water
Spin Cycle
End
The washing machine control sequence starts by filling water, then washing, draining, spinning, and finally stopping.
IF Start THEN
FillWater := TRUE;
IF WaterLevel = Full THEN
WashCycle := TRUE;
END_IF;
END_IF;| Step | Start Signal | FillWater | WaterLevel | WashCycle | DrainWater | SpinCycle | Action |
|---|---|---|---|---|---|---|---|
| 1 | ON | TRUE | Empty | FALSE | FALSE | FALSE | Start filling water |
| 2 | ON | TRUE | Full | TRUE | FALSE | FALSE | Water full, start wash cycle |
| 3 | ON | FALSE | Full | TRUE | FALSE | FALSE | Wash cycle running |
| 4 | ON | FALSE | Full | FALSE | TRUE | FALSE | Drain water after wash |
| 5 | ON | FALSE | Empty | FALSE | FALSE | TRUE | Spin cycle running |
| 6 | OFF | FALSE | Empty | FALSE | FALSE | FALSE | Cycle complete, stop machine |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | After Step 4 | After Step 5 | Final |
|---|---|---|---|---|---|---|---|
| Start Signal | OFF | ON | ON | ON | ON | ON | OFF |
| FillWater | FALSE | TRUE | FALSE | FALSE | FALSE | FALSE | FALSE |
| WaterLevel | Empty | Empty | Full | Full | Full | Empty | Empty |
| WashCycle | FALSE | FALSE | TRUE | TRUE | FALSE | FALSE | FALSE |
| DrainWater | FALSE | FALSE | FALSE | FALSE | TRUE | FALSE | FALSE |
| SpinCycle | FALSE | FALSE | FALSE | FALSE | FALSE | TRUE | FALSE |
Washing machine control sequence in PLC: Start signal triggers FillWater. When water is Full, FillWater stops, WashCycle starts. After washing, DrainWater activates. Then SpinCycle runs. Start OFF stops all cycles.
step = 1
if step == 1 and timer_done:
step = 2
elif step == 2 and timer_done:
step = 3
elif step == 3 and timer_done:
step = 4
step after three timer_done events?if step == 1 and timer_done:
step = 2
if step == 2 and timer_done:
step = 3
if step == 3 and timer_done:
step = 4
Pass the test and this pattern moves unknown