CharCurve_DINT (FB)¶
FUNCTION_BLOCK CharCurve_DINT
This function block will evaluate a piecewise linear function (the characteristic curve) at an integral point \(x \in \mathbb{Z}\). The characteristic curve is specified by a defined number of integral sampling points \((x_{1}, y_{1}), \dots , (x_{n}, y_{n}) \in \mathbb{Z^{2}}\)
- InOut:
Scope
Name
Type
Comment
Input
diInputValueDINTinterpolation point \(x \in \mathbb{Z}\)
usiNoPointsUSINTnumber \(N\) of sampling points defining the characteristic curve (\(2 \leq N \leq 11\))
Inout
ap2diPointsARRAY [0..10] OF POINT2_DINT
array of \(N\) two dimensional sampling points \((x_{i}, y_{i})\) with \(1 \leq i \leq N\)
Output
diOutputValueDINTinterpolated value at point \(x \in \mathbb{Z}\)
xErrorBOOLerror flag
wErrorIDWORDinformation on error0: No error1: error within array of sampling points (i.e. the sampling points aren’t arranged in ascending order)2: interpolation pointdiInputValueis outside of area covered by sampling points (\(x \notin [x_{1}, x_{n}]\))4: invalid number of sampling points