FB_BA_AnalogValue

The function block FB_BA_AnalogValue is used to operate or monitor an analog setpoint.
Within the parameters, it is possible to activate upper (stHighLimit) and lower (stLowLimit) limit value monitoring of the output signal fPresentValue.
In addition, the function block can be provided with a PT-1 filter to avoid strong fluctuations and jumps caused by the input signal fValue. The filter is activated by adjusting the filter constants nDampingConstant > 0.
Syntax
FUNCTION_BLOCK FB_BA_AnalogValue
VAR_INPUT
fValue : REAL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
{region 'Variable Parameters'}
{attribute 'parameterCategory':='Hardware'}
fOffset : REAL;
{attribute 'parameterCategory':='EventConfig'}
stHighLimit : ST_BA_LimitParameter := (nTimeToAbnormal := 1, nTimeToNormal := 1);
{attribute 'parameterCategory':='EventConfig'}
stLowLimit : ST_BA_LimitParameter := (nTimeToAbnormal := 1, nTimeToNormal := 1);
{attribute 'parameterCategory':='Value'}
nDampingConstant : UDINT := 0;
{endregion}
END_VAR
VAR_OUTPUT
fPresentValue : REAL;
bHighLimit : BOOL;
bLowLimit : BOOL;
END_VAR
Inputs CONSTANT PERSISTENT
Name | Type | Description |
|---|---|---|
fOffset | REAL | The offset can be used to adjust the scaled output value fPresentValue. |
stHighLimit | Data and command structure for upper limit value monitoring. | |
stLowLimit | Data and command structure for lower limit value monitoring. | |
nDampingConstant | UDINT | To avoid strong fluctuations and jumps in the input signal, the function block is provided with a PT1 filter. This filter is activated by setting the filter constant nDampingConstant to greater than 0. |
Outputs
Name | Type | Description |
|---|---|---|
fPresentValue | REAL | Output value. |
bHighLimit | BOOL | The upper limit monitoring is active. |
bLowLimit | BOOL | The lower limit monitoring is active. |
Prerequisites
Development environment | Required PLC library |
|---|---|
TwinCAT from v3.1.4024.62 | Tc3_BA2 from v5.5.14.0 |