Table of Contents

Digital filter

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

InputTypeDescription Default value
IN BOOLInput value False
T TIMEThe block does not change the output OUT faster than once every T secs5s

Outputs

OutputTypeDescription
OUT BOOLFiltered output signal
TRES TIMETimeout 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.