Four-point function

B81_FOURPOINTFUNCTIONNODE

PROGRAM TEST2_B80
 VAR
 FB:LIB.CORE.V1_0.B81_FOURPOINTFUNCTIONNODE;
 IN_V:REAL;
 X1_V:REAL:=0;
 X2_V:REAL:=20;
 X3_V:REAL:=60;
 X4_V:REAL:=80;
 Y1_V:REAL:=0;
 Y2_V:REAL:=100;
 Y3_V:REAL:=150;
 Y4_V:REAL:=180;
 OUT_V:REAL;
 END_VAR 
FB(IN:=IN_V, X1:=X1_V, X2:=X2_V, X3:=X3_V, X4:=X4_V, Y1:=Y1_V, Y2:=Y2_V, Y3:=Y3_V, Y4:=Y4_V);
OUT_V:=FB.OUT;
END_PROGRAM

LIB\CORE

V1.0

Block defines an arbitrary transfer curve given by four points.

InputTypeDescription Default value
IN REALInput signal 0
X1 REAL1.point, x coordinate0
X2 REAL2.point, x coordinate1
X3 REAL3.point, x coordinate2
X4 REAL4.point, x coordinate3
Y1 REAL1.point, y coordinate0
Y2 REAL2.point, y coordinate1
Y3 REAL3.point, y coordinate2
Y4 REAL4.point, y coordinate3
OutputTypeDescription
OUT REALOutput signal
SIGN BOOLSign of the output signal

The block implements an arbitrary transfer curve given by four points – [X1,Y1], [X2,Y2],[X3,Y3],[X4,Y4]. The function is constant behind the last point and before the first point as well, see the Figure below.

Let us create a function which is depicted on the Figure below, right. According to the Figure we want an increasing function with slope 1 for “all possible values” greater then zero. If “all possible values” in our case are less then for example 1000 we can solve the problem by the following setting: [X1,Y1]=[0,0], [X2,Y2]=[X3,Y3]=[X4,Y4]=[1000,1000].


  • © Energocentrum Plus, s.r.o. 2017 - 2024