FB_BA_ShortLongClick

FB_BA_ShortLongClick 1:

The function block FB_BA_ShortLongClick is used to differentiate between a short and long button press.

If the input bSwi is present for longer than nSwiOvrTi [ms], the output bLongClick is set for one PLC cycle. Otherwise, the output bShortClick is issued for one PLC cycle.

If a continuous signal is required for long button presses, the function block FB_BA_ShortLongPress must be used.

Syntax

FUNCTION_BLOCK FB_BA_ShortLongClick
VAR_INPUT
  bSwi           : BOOL;
  nSwiOvrTi      : UDINT := 500;
END_VAR
VAR_OUTPUT
  bShortClick    : BOOL;
  bLongClick     : BOOL;
END_VAR

FB_BA_ShortLongClick 2: Inputs

Name

Type

Description

bSwi

BOOL

Input signal.

nSwiOvrTi

UDINT

Time duration in milliseconds after which the input signal is interpreted as a long button press. Preset to 500 ms

FB_BA_ShortLongClick 3: Outputs

Name

Type

Description

bShortClick

BOOL

Signals a short button press for a PLC cycle.

bLongClick

BOOL

Signals a long button press for a PLC cycle.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.62

Tc3_BA2 from v5.5.25.0