sys::Obj sys::Virtual sys::Component func::Linearize
public class Linearize
[niagaraIcon="module://icons/x16/control/util/xy.png"]
Converts a table of values into a curve using linear interpolation between the values. Individual slope/intercept constants are computed between the x's and y's using the formula y = mx + b, where m = ym - yn/xm - xn
If in is not in the range of x0 to x9, then output is set to "nan"
Note that slope may be positive or negative, and is indicated by comparison of x1 and x0 (positive if x1 > x0, negitive if x1 < x0)
public property float in
input
public property float out [readonly]
linearized output
public float tmp
public property float x0 [config]
linear interpolation x0 point
public property float x1 [config]
linear interpolation x1 point
public property float x2 [config]
linear interpolation x2 point
public property float x3 [config]
linear interpolation x3 point
public property float x4 [config]
linear interpolation x4 point
public property float x5 [config]
linear interpolation x5 point
public property float x6 [config]
linear interpolation x6 point
public property float x7 [config]
linear interpolation x7 point
public property float x8 [config]
linear interpolation x8 point
public property float x9 [config]
linear interpolation x9 point
public property float y0 [config]
linear interpolation y0 point
public property float y1 [config]
linear interpolation y1 point
public property float y2 [config]
linear interpolation y2 point
public property float y3 [config]
linear interpolation y3 point
public property float y4 [config]
linear interpolation y4 point
public property float y5 [config]
linear interpolation Y5 point
public property float y6 [config]
linear interpolation Y6 point
public property float y7 [config]
linear interpolation Y7 point
public property float y8 [config]
linear interpolation Y8 point
public property float y9 [config]
linear interpolation Y9 point
public virtual void convert(float Y2, float Y1, float X2, float X1)
Convert value in to value out by using linear interpolation
between point1 and point2 using formula y=mx + b
public virtual override void execute()
Execute is called once every scan to convert 'in' to 'out' using linear interpolation between inflection points (x,y)