Sedona

func::Linearize


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)


in

public property float in

input

out

public property float out [readonly]

linearized output

tmp

public float tmp

x0

public property float x0 [config]

linear interpolation x0 point

x1

public property float x1 [config]

linear interpolation x1 point

x2

public property float x2 [config]

linear interpolation x2 point

x3

public property float x3 [config]

linear interpolation x3 point

x4

public property float x4 [config]

linear interpolation x4 point

x5

public property float x5 [config]

linear interpolation x5 point

x6

public property float x6 [config]

linear interpolation x6 point

x7

public property float x7 [config]

linear interpolation x7 point

x8

public property float x8 [config]

linear interpolation x8 point

x9

public property float x9 [config]

linear interpolation x9 point

y0

public property float y0 [config]

linear interpolation y0 point

y1

public property float y1 [config]

linear interpolation y1 point

y2

public property float y2 [config]

linear interpolation y2 point

y3

public property float y3 [config]

linear interpolation y3 point

y4

public property float y4 [config]

linear interpolation y4 point

y5

public property float y5 [config]

linear interpolation Y5 point

y6

public property float y6 [config]

linear interpolation Y6 point

y7

public property float y7 [config]

linear interpolation Y7 point

y8

public property float y8 [config]

linear interpolation Y8 point

y9

public property float y9 [config]

linear interpolation Y9 point

convert

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
execute

public virtual override void execute()

Execute is called once every scan to convert 'in' to 'out' using linear interpolation between inflection points (x,y)