FB_BA_Chrct04
Linear interpolation with 4 interpolation points
Functional description
The function block FB_BA_Chrct04 represents a linear interpolation with four interpolation points and can be used to generate a characteristic curve. The characteristic curve is determined by the interpolation points [lrX1/lrY1] to [lrX4/lrY4]. If the input variable bLmt is TRUE, lrY is limited by lrY01 and lrY04. 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.
VAR_INPUT
lrX : LREAL;
lrX01 : LREAL;
lrX02 : LREAL;
lrX03 : LREAL;
lrX04 : LREAL;
lrY01 : LREAL;
lrY02 : LREAL;
lrY03 : LREAL;
lrY04 : LREAL;
bLmt : BOOL;
lrX: input value of the characteristic curve
lrX01: X-value for interpolation point P1
lrX02: X-value for interpolation point P2
lrX03: X-value for interpolation point P3
lrX04: X-value for interpolation point P4
lrY01: Y-value for interpolation point P1
lrY02: Y-value for interpolation point P2
lrY03: Y-value for interpolation point P3
lrY04: Y-value for interpolation point P4
bLmt: limitation of the output value lrY
Inputs/outputs
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 |