Siemens SIMATIC IOT Operating Instructions Manual page 85

Hide thumbs Also See for SIMATIC IOT:
Table of Contents

Advertisement

}
}
Example: converts real to float with Python
def real_to_float(u32:int) -> float:
power_count)
SIMATIC IOT2050
Operating Instructions, 03/2024, A5E39456816-AF
power_count -= 1;
mantissa_int += 1;
return pow(-1, sign) * mantissa_int * pow(2, exponent);
"""
Convert IEEE754 floating point.
"""
sign = u32 >> 31
exponent = ((u32 >> 23) & 0xFF) - 127
mantissa = u32 & 0x7FFFFF
power_count = -1
mantissa_int = 0
for i in range(0, 23):
mantissa_int += ((mantissa >> (22 - i)) & 1) * pow(2,
power_count -= 1
mantissa_int += 1
return pow(-1, sign) * mantissa_int * pow(2, exponent)
Maintaining and repairing the device
6.6 Configure IOT2050 SM
85

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic iot2050Simatic iot2050 smSimatic iot2050 m.2

Table of Contents