LIN_TRAFO (FB)¶
FUNCTION_BLOCK LIN_TRAFO
Performs a linear transformation
The transformation is performed by using the minimum and maximum values of the inputs for a linear approximation of the output value.
Application example:
A temperature sensor provides Volt-values (input IN). These are to be converted to temperature
values in degree centigrade (output OUT). The input (Volt) values range is defined by the
limits IN_MIN=0 and IN_MAX=10. The output(degree centigrade) value range is defined by the
limits OUT_MIN=-20 and OUT_MAX=40.
Thus for an input of 5 Volt a temperature of 10 degree centigrade will result.
- InOut:
Scope
Name
Type
Comment
Input
INREALInput value
IN_MINREALMinimum input value
IN_MAXREALMaximum input value
OUT_MINREALCorresponding minimum output value
OUT_MAXREALCorresponding maximum output value
Output
OUTREALOutput value
ERRORBOOLTRUE:IN_MIN=IN_MAXorINout of input range