FB_BA_Chrct02

FB_BA_Chrct02 1:

The function block FB_BA_Chrct02 represents a linear interpolation with 2 interpolation points and can be used to generate a characteristic curve. The characteristic curve is determined by the interpolation points [rX1/rY1] and [rX2/rY2]. If the input variable bLmt is TRUE, rY is limited by rY01 and rY02. If bLmt is FALSE, rY is not limited.

FB_BA_Chrct02 2:

Error handling

The input values for rX[n+1] must always be at least 0.0000001 greater than the values for rX[n].
In the event of an error the variable sErrDescr indicates that at one point of the characteristic curve the values are not monotonically increasing.

VAR_INPUT

rX    : REAL;
rX01  : REAL;
rX02  : REAL;
rY01  : REAL;
rY02  : REAL;
bLmt  : BOOL;

rX: Input value of the characteristic curve.

rX01: X-value for interpolation point P1.

rX02: X-value for interpolation point P2.

rY01: Y-value for interpolation point P1.

rY02: Y-value for interpolation point P2.

bLmt: Limit for the output value rY.

VAR_OUTPUT

rY         : REAL;
bErr       : BOOL;
sErrDescr  : T_MAXSTRING;

rY: Calculated output value of the characteristic curve.

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

sErrDescr: Contains the error description.

Error description

01: Error: rX01 must not be equal to rX02.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.7

Tc3_BA from v1.1.6.0