Delayed Shutdown
medium
Holds the run output high for a cooldown period after a stop command is received.
What it teaches
Off-delay with a real-world framing: equipment runs, Stop fires, the output stays on for the cooldown, then drops. The twist: Start during cooldown cancels it and returns to running — that needs a small state machine (Stopped, Running, Cooldown), not just a bare off-delay timer.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Start | Input | BOOL | 0 | Starts the equipment (1 = start) |
| In_Stop | Input | BOOL | 0 | Stops the equipment (1 = stop) |
| Cfg_CooldownMs | Input | DINT | 5000 | Cooldown period in milliseconds |
| Out_Run | Output | BOOL | 0 | Equipment run command |
Required behavior
- Equipment starts and Out_Run becomes 1 when In_Start is 1 and In_Stop is 0. Out_Run stays 1 after In_Start is released.
- When In_Stop is 1, the equipment enters a cooldown phase if it was running. The cooldown continues after In_Stop is released.
- During the cooldown phase, Out_Run remains 1.
- After the cooldown timer reaches Cfg_CooldownMs, Out_Run becomes 0.
- If In_Start is 1 during the cooldown phase and In_Stop is 0, the cooldown is cancelled and the equipment returns to normal running.