Bloc Fonction: Function Block For Linear Approximation (CJ/CS Only)
Bloc Fonction: Function Block For Linear Approximation (CJ/CS Only)
Basic Function The LinearApproximation FB calculates y=f(x) when f(x) is not linear
Symbol
File LinearApproximation.cxf
Applicable Models CJ series and CS series (not CS1D)
Function description Calculates data_out for a data_in using tables table-in and table_data doing
linear approximation between two points of tables.
Quantity = &5
D100 : -100,0 D300 : -1000,0
D102 : -50,0 D302 : +2000,0
D104 : +0,0 D304 : -3000,0
D106 : +50,0 D306 : +4000,0
D108 : +100,0 D308 : -5000,0
data_in = -101,0 => data_out = -1000,0
data_in = -100,0 => data_out = -1000,0
data_in = -99,0 => data_out = -940,0
data_in = -1,0 => data_out = -2900,0
data_in = 0,0 => data_out = -3000,0
data_in = +1,0 => data_out = -2860,0
data_in = 51,0 => data_out = +3820,0
data_in = +100,0 => data_out = -5000,0
data_in = +101,0 => data_out = -5000,0
Restriction Table_in[0]<=Table_in[1]<=Table_in[quantity-2]<= Table_in[quantity-1]
Input Variables
Name Data type Range Description
Data_in REAL Limits of REAL data Value to be converted
Quantity UINT 2 to 32768 Number of values in Table_in and Table_out
Output Variables
Name Data type Range Description
Data_out REAL Limits of REAL data Value converted
Input/output Variables
Name Data type Range Description
Table_in REAL Limits of REAL data Table of values
Table_out REAL Limits of REAL data Table of values