UT_DEBOUNCE — On/off delay filter
UT_DEBOUNCE — On/off delay filter
Cleans up a noisy contact: a float switch on a choppy surface, a pressure switch
near its setpoint, a bouncing limit switch.
Pins
| Pin | Type | Default | What to wire | |
|---|---|---|---|---|
| in | In |
BOOL | FALSE | Noisy signal |
| in | OnDelay |
TIME | T#100ms | Must be TRUE this long to switch on |
| in | OffDelay |
TIME | T#100ms | Must be FALSE this long to switch off |
| out | Q |
BOOL | Clean signal | |
| out | Rising / Falling |
BOOL | One scan when Q switches |
|
| out | ET |
TIME | How long In has held its new state (0 when Q agrees with In) |
|
| out | Remaining |
TIME | The delay still to run before Q follows (0 when Q agrees with In) |
How it works
Qswitches on onceInhas been TRUE forOnDelaywithout a break, and off
once it has been FALSE forOffDelaywithout a break. Anything shorter is ignored.- A delay of 0 (or a negative one) passes
Instraight through in the same scan. - A delay changed while timing acts at once: lowering
OnDelaybelow the time
Inhas already been on switchesQon at the next scan. Qstarts off. An input that is already on at start switchesQon afterOnDelay.- While
Indiffers fromQ,ETcounts up andRemainingcounts down, like a
TON'sETandPT - ET: show "float high, pump stops in 3 s" on an HMI. OnceQ
follows, orIngoes back, both are 0. Inis only seen once per scan, so a change shorter than the task interval may be missed.
For a switch that needs alarms or chatter detection, use UT_DIGITAL_IN.
Last updated 2 hours ago
Was this helpful?