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 |
IN |
REAL |
Input value |
IN_MIN |
REAL |
Minimum input value |
|
IN_MAX |
REAL |
Maximum input value |
|
OUT_MIN |
REAL |
Corresponding minimum output value |
|
OUT_MAX |
REAL |
Corresponding maximum output value |
|
Output |
OUT |
REAL |
Output value |
ERROR |
BOOL |
TRUE: IN_MIN = IN_MAX or IN out of input range |