Wash Cycle
hard
Runs Fill, Mix, and Drain actuators in order with pause, resume, and reset controls.
What it teaches
Combine state, retentive phase timers, and real actuator outputs. Pause saves elapsed time but turns every actuator off; Resume continues the same phase.
Inputs and outputs
| Tag | Type | Default | Description |
|---|---|---|---|
| In_Start | BOOL | — | Starts a new cycle from Idle |
| In_Pause | BOOL | — | Pauses the active phase |
| In_Resume | BOOL | — | Continues a paused phase |
| In_Reset | BOOL | — | Aborts the cycle and returns to Idle |
| Cfg_FillTime | DINT | 2000 | Fill duration in milliseconds |
| Cfg_MixTime | DINT | 3000 | Mix duration in milliseconds |
| Cfg_DrainTime | DINT | 2500 | Drain duration in milliseconds |
| Out_FillValve | BOOL | — | Opens during the active Fill phase |
| Out_Mixer | BOOL | — | Runs during the active Mix phase |
| Out_DrainValve | BOOL | — | Opens during the active Drain phase |
| Sts_State | DINT | — | 0=Idle, 1=Fill, 2=Mix, 3=Drain |
| Sts_Paused | BOOL | — | 1 while phase timing and actuators are paused |
Required behavior
- A new Start press in Idle begins Fill. The cycle then advances to Mix, Drain, and back to Idle after each configured duration.
- Only the actuator for the current phase is on. All three actuators are off in Idle.
- A Pause press freezes the current phase timer and turns all actuators off. Resume continues the same phase from its saved elapsed time.
- Start is ignored outside Idle. Pause is ignored in Idle. If Pause and Resume are pressed together, Pause wins.
- Reset wins over every other command, turns all actuators off, clears Pause, and makes the next Start begin a fresh Fill.