FB_BA_Chrct02
Linear interpolation with 2 interpolation points
Functional description
The function block FB_BA_Chrct02 represents a linear interpolation with two interpolation points and can be used to generate a characteristic curve. The characteristic curve is determined by the interpolation points [lrX1/lrY1] and [lrX2/lrY2]. If the input variable bLmt is TRUE, lrY is limited by lrY01 and lrY02. If bLmt is FALSE, lrY is not limited.
Error handling
The input values for lrX[n+1] must always be at least 0.0000001 greater than the values for lrX[n].
In the event of an error the variable udiErrId indicates at which point of the characteristic curve the values are not monotonically increasing.
Inputs/outputs
VAR_INPUT
lrX : LREAL;
lrX01 : LREAL;
lrX02 : LREAL;
lrY01 : LREAL;
lrY02 : LREAL;
bLmt : BOOL;
lrX: input value of the characteristic curve.
lrX01: X-value for interpolation point P1.
lrX02: X-value for interpolation point P2.
lrY01: Y-value for interpolation point P1.
lrY02: Y-value for interpolation point P2.
bLmt: limitation of the output value lrY.
VAR_OUTPUT
lrY : LREAL;
bErr : BOOL;
udiErrId : UDINT;
udiErrArg : UDINT;
lrY: calculated output value of the characteristic curve
bErr: this output is switched to TRUE if the parameters entered are erroneous.
udiErrId / udiErrArg: contains the error number and the error argument. See error codes.
Requirements
Development environment | Target system | required library | required supplement |
---|---|---|---|
TwinCAT 2.11 R3/x64 | PC/CX | TcBA library from V1.0.0 | TS8040 | TwinCAT Building Automation from V1.0.0 |