FB_BA_AnalogOutput

FB_BA_AnalogOutput 1:

The function block FB_BA_AnalogOutput is used to control continuous actuators such as valves or dampers.

The input value fValue is converted into an analog value nRawValue by linear interpolation with 2 interpolation points.

FB_BA_AnalogOutput 2:

Within the parameters, it is possible to activate upper (stHighLimit) and lower (stLowLimit) limit value monitoring of the output signal fPresentValue.

Syntax

FUNCTION_BLOCK FB_BA_AnalogOutput
VAR_INPUT
  fValue           : REAL;
END_VAR
VAR_INPUT CONSTANT PERSISTENT
  {region 'Variable Parameters'}
    {attribute 'parameterCategory':='Hardware'}
    stScale        : ST_BA_ScaleRealToInt := (fX01 := 0,fX02 := 100,nY01 := 0,nY02 := 32767);
    {attribute 'parameterCategory':='EventConfig'}
    stHighLimit    : ST_BA_LimitParameter := (nTimeToAbnormal := 1, nTimeToNormal := 1);
    {attribute 'parameterCategory':='EventConfig'}
    stLowLimit     : ST_BA_LimitParameter := (nTimeToAbnormal := 1, nTimeToNormal := 1);
  {endregion}
END_VAR
VAR_OUTPUT
  fPresentValue    : REAL;
  bHighLimit       : BOOL;
  bLowLimit        : BOOL;
  nRawValue        : INT;
END_VAR

FB_BA_AnalogOutput 3: Inputs

Name

Type

Description

fValue

REAL

Setpoint for the analog output.

FB_BA_AnalogOutput 4: Inputs CONSTANT PERSISTENT

Name

Type

Description

stScale

ST_BA_ScaleRealToInt

The structure contains the interpolation points for linear interpolation.

stHighLimit

ST_BA_LimitParameter

Data and command structure for upper limit value monitoring.

stLowLimit

ST_BA_LimitParameter

Data and command structure for lower limit value monitoring.

FB_BA_AnalogOutput 5: Outputs

Name

Type

Description

fPresentValue

REAL

Current value -> fPresentValue = fValue + fOffset.

bHighLimit

BOOL

The upper limit monitoring is active.

bLowLimit

BOOL

The lower limit monitoring is active.

nRawValue

INT

Scaled value for an analog output terminal.

Prerequisites

Development environment

Required PLC library

TwinCAT from v3.1.4024.62

Tc3_BA2 from v5.5.14.0