FB_BA_Chrct32
The function block FB_BA_Chrct32 represents a linear interpolation with up to 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 [arrX[1]/arrY[1] to [arrX[n]/arrY[n]]. If the input variable bLmt is TRUE, rY is limited by arrY[1] and arrY[n]. If bLmt is FALSE, rY is not limited.
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.
The parameter for the number of interpolation points, diNumOfElem, must be in the range 2..32.
VAR_INPUT
rX : REAL;
arrX : ARRAY [1..cBA_NumOfElem] OF REAL;
arrY : ARRAY [1..cBA_NumOfElem] OF REAL;
diNumOfElem : DINT(2..32);
bLmt : BOOL;
rX: Input value of the characteristic curve
arrX: Field with the X-values for the interpolation points.
arrY: Field with the Y-values for the interpolation points.
diNumOfElem: Number of interpolation points. Internally limited to values between 2 and 32.
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: at the specified element. The sequence must always be rX01 > rX02 > rXn or rX01 < rX02 < rXn. |
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4024.7 | Tc3_BA from v1.1.6.0 |