F_Byte_to_Temp : REAL

This function converts a byte raw value into a REAL variable.
Temperature data transmitted with EnOcean® is one byte in size and is sent in a specific format. This data is usually scaled to a specific temperature value.
For example, a value is transmitted from a range of values from 0 to 40°C. The minimum and maximum data value and the raw value are transferred to the function. The output of the function then outputs the temperature as REAL variable.
Inputs
VAR_INPUT
byData : BYTE;
minTemp : REAL := 0;
maxTemp : REAL := 40;
END_VAR
Name | Type | Description |
---|---|---|
byData | BYTE | Raw data |
minTemp | REAL | Minimum temperature |
maxTemp | REAL | Maximum temperature |
Prerequisites
Development environment | PLC library to include |
---|---|
TwinCAT from v3.1.4020.14 | Tc2_EnOcean from v3.3.5.0 |