FB_BA_Hys_21

FB_BA_Hys_21 1:

The template represents two hysteresis functions with fixed switching points.

It is used to monitor analog values, such as an air filter.

The hysteresis function HysPreAlarm triggers a pre-alarm. Maintenance can take place on an air filter, for example.

The hysteresis function HysMainAlarm triggers a main alarm and can be used as a fault that results in plant shutdown. The air filter must be serviced.

FB_BA_Hys_21 2:

The initialization of the template takes place within the method FB_Init.

Block diagram

FB_BA_Hys_21 3:

Syntax

FUNCTION_BLOCK FB_BA_Hys_21 EXTENDS FB_BA_View
VAR_INPUT
  bEn                : BOOL;
  fIn                : REAL;
END_VAR
VAR_OUTPUT
  bDst               : BOOL;
END_VAR
VAR_INPUT CONSTANT
  HysPreAlarmOn      : FB_BA_AV_Op;
  HysPreAlarmOff     : FB_BA_AV_Op;
  HysMainAlarmOn     : FB_BA_AV_Op;
  HysMainAlarmOff    : FB_BA_AV_Op;
  DstPreAlarm        : FB_BA_BV;
  DstMainAlarm       : FB_BA_BV;
END_VAR
VAR
  HysPreAlarm        : FB_BA_Swi2P;
  HysMainAlarm       : FB_BA_Swi2P;
END_VAR

FB_BA_Hys_21 4: Inputs

Name

Type

Description

bEn

BOOL

General enable of the function block.

fIn

REAL

Actual value

FB_BA_Hys_21 5: Outputs

Name

Type

Description

bDst

BOOL

Display of a fault or the BV object is active.

bDst is only active if the property bEventDetectionEnable of the BV object was set to TRUE.

The monitoring of the binary feedback indicates a fault.

FB_BA_Hys_21 6: Inputs CONSTANT

Name

Type

Description

HysPreAlarmOn

FB_BA_AV_Op

AV object for entering the upper limit value of the hysteresis function HysPreAlarm.

HysPreAlarmOff

FB_BA_AV_Op

AV object for entering the lower limit value of the hysteresis function HysPreAlarm.

HysMainAlarmOn

FB_BA_AV_Op

AV object for entering the upper limit value of the hysteresis function HysMainAlarm.

HysMainAlarmOff

FB_BA_AV_Op

AV object for entering the lower limit value of the hysteresis function HysMainAlarm.

DstPreAlarm

FB_BA_BV

The binary object is used to indicate the pre-alarm of the hysteresis function HysPreAlarm.

A message is triggered via Intrinsic Reporting.

DstMainAlarm

FB_BA_BV

The binary object is used to indicate the main alarm of the hysteresis function HysMainAlarm.

A message is triggered via Intrinsic Reporting.

A fault that results in plant shutdown must be parameterized in the FB_init method via eEnPlantLock.

Variables

Name

Type

Description

HysPreAlarm

FB_BA_Swi2P

The function block is the core of the hysteresis function pre-alarm.

HysMainAlarm

FB_BA_Swi2P

The function block is the core of the hysteresis function main alarm.

Requirements

Development environment

Necessary function

TwinCAT from v3.1.4024.35

TF8040 | TwinCAT Building Automation from V5.2.1.0