====== Four-point function ====== {{:en:mervis-ide:35-help:b81.png}} ===== Block name ===== B81_FOURPOINTFUNCTIONNODE ===== ST call ===== 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 ===== Library ===== LIB\CORE ===== Version ===== V1.0 ===== Description ===== Block defines an arbitrary transfer curve given by four points.\\ ===== Inputs ===== |Input|Type|Description |Default value| |IN |REAL|Input signal |0 | |X1 |REAL|1.point, x coordinate|0 | |X2 |REAL|2.point, x coordinate|1 | |X3 |REAL|3.point, x coordinate|2 | |X4 |REAL|4.point, x coordinate|3 | |Y1 |REAL|1.point, y coordinate|0 | |Y2 |REAL|2.point, y coordinate|1 | |Y3 |REAL|3.point, y coordinate|2 | |Y4 |REAL|4.point, y coordinate|3 | ===== Outputs ===== |Output|Type|Description | |OUT |REAL|Output signal | |SIGN |BOOL|Sign of the output signal| ===== Function ===== 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.\\ \\ {{:en:mervis-ide:35-help:b81_2.png}} ===== Application example ===== 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].\\ // {{:en:mervis-ide:35-help:b81_3.png}}\\ \\