Documentation

Digital Filter (BD15)

Block name

BD15_DIGITAL_FILTER

ST call

PROGRAM BD15_TEST
VAR
IN1, OUT1: BOOL;
FB: LIB.CORE.V1_0.BD15_DIGITAL_FILTER;
END_VAR
FB(IN:=IN1);
OUT1:=FB.OUT;
END_PROGRAM

Library

LIB\CORE

Version

V1.0

Description

The block copies the input IN to the output OUT with a functionality that the OUT value changes not more frequently than every T seconds. This means that the block filters fast input changes, see figure below. The block is used to filter, or debounce, the input signal.

Inputs

Input Type Description Default value
IN BOOL Input value False
T TIME The block does not change the output OUT faster than once every T secs 5s

Outputs

Output Type Description
OUT BOOL Filtered output signal
TRES TIME Timeout to next possible change of output (TRES = 0 - the block is ready, TRES > 0 - the block is waiting).

Application example

The block is used to prevent a digital signal from bouncing. The pulse generator is simulating the bounced signal, at the BD15 block output there is filtered (debounced) signal.