Debounce
medium
Filters contact bounce by ignoring input transitions shorter than a preset time.
What it teaches
Ignore brief flickers in an input. The input has to stay in its new state for a set time before the output follows — the standard cure for button bounce or sensor noise.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| In_Signal | Input | BOOL | 0 | Raw input signal to be debounced |
| Cfg_Delay | Input | DINT | 500 | Debounce time in milliseconds |
| Out_Signal | Output | BOOL | 0 | Debounced output signal |
Required behavior
- Output transitions high when In_Signal is continuously high for Cfg_Delay milliseconds.
- Output transitions low when In_Signal is continuously low for Cfg_Delay milliseconds.
- Input excursions shorter than Cfg_Delay are ignored.