F_Byte_to_Temp : REAL
This function converts a byte raw value into a REAL variable.
In EnOcean, temperature data are transmitted in a certain format, which is one byte in size. These data are usually scaled to a certain temperature value.
For example, a value is transmitted from a range of values from 0 to 40 °C.
The minimum and maximum data values are now input to the function along with the raw value. The output of the function then outputs the temperature as REAL variable.
VAR_INPUT
byData : BYTE;
minTemp : REAL := 0;
maxTemp : REAL := 40;
byData: Raw data.
minTemp: Minimum temperature.
maxTemp: Maximum temperature.
F_Byte_To_Temp: Temperature value, scaled over minTemp and maxTemp.