FB_BA_Chrct32

FB_BA_Chrct32 1:

The function block FB_BA_Chrct32 represents a linear interpolation with 32 interpolation points and can be used to generate a characteristic curve. In contrast to the "smaller" interpolation function blocks FB_BA_Chrct02, FB_BA_Chrct04 and FB_BA_Chrct07, and in the interest of clarity, the interpolation points are determined via field variables [aX[1]/aY[1] to [aX[n]/aY[n]].

The input variable nNumOfElem determines the number of interpolation points from the field ranges aX/aY.

The calculated output value fCalcVal is limited by fYMin or fYMax.

FB_BA_Chrct32 2:

Error handling

The input values for aX[n+1] must always be greater than from aX[n].

In case of an error the variable bErr indicates this. The property ErrorDescription gives out a detailed description.

The input value for fYMin must not be greater than fYMax.

In case of an error the variable bErr indicates this. The property ErrorDescription gives out a detailed description.

FB_BA_Chrct32 3: Inputs

VAR_INPUT
  fX          : REAL;
  aX          : ARRAY [1..cBA_NumOfElem] OF REAL;
  aY          : ARRAY [1..cBA_NumOfElem] OF REAL;
  nNumOfElem  : DINT(2..32);
  fYMin       : REAL;
  fYMax       : REAL;
END_VAR

Name

Type

Description

fX

REAL

Input value of the characteristic curve.

aX

ARRAY OF REAL

X-value for the interpolation points.

aY

ARRAY OF REAL

Y-value for the interpolation points.

nNumOfElem

DINT

Number of interpolation points. Internally limited to the range 2 ... 32.

fYMin

REAL

Lower limit of fCalcVal. The input for the lower limit is limited to the global parameter BAComn_Global.fMinReal from the Tc3_BA2_Common library.

fYMax

REAL

Upper limit of fCalcVal. The input for the upper limit is limited to the global parameter BAComn_Global.fMaxReal from the Tc3_BA2_Common library.

FB_BA_Chrct32 4: Outputs

VAR_OUTPUT
  fCalcVal   : REAL;
  bErr       : BOOL;
END_VAR

Name

Type

Description

fCalcVal

REAL

Calculated output value of the characteristic curve.

bErr

BOOL

This output is switched to TRUE if the parameters entered are erroneous.

FB_BA_Chrct32 5: Properties

Name

Type

Access

Description

ErrorDescription

T_MaxString

Get

Issues a detailed description of errors, see error handling.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0