Data format of the devices
5
Data format of the devices
NOTICE!
When devices are used on a PROFIBUS-DP system, it is necessary to use
the correct data format!
Two different data formats are available for selection:
– Little Endian
– Big Endian
– Communication with a Siemens PLC usually uses the Big Endian
format.
5.1
Integer values
Integer values are transmitted in the following format:
first the
then the
5.2
Floating-point values/real values
Floating-point values/real values are stored in the device in the IEEE-754 standard format
(32-bit).
Single-precision floating-point format (32-bit) to Standard IEEE 754
SEEEEEEE
Byte 1
S - Sign bit (Bit 31)
E - Exponent in the twos complement (Bit 23 to Bit 30)
M - 23 -bit normalized mantissa (Bit 0 to Bit 22)
Example: Calculation of the real number from the sign, exponent, and mantissa.
Byte1 = 40h, Byte2 = F0, Byte 3 = 0, Byte 4 = 0
40F00000h = 0100 0000 1111 0000 0000 0000 0000 0000b
S = 0
E = 100 0000 1
M = 111 0000 0000 0000 0000 0000
S
Value = -1
· 2
0
Value = -1
· 2
2
Value = 1 · 2
Value = 1 · 4 · 1,875
Value = 7,5
417102396 Rev. 1-10.2019
EMMMMMMM
Byte 2
Exponent-127
· (1 + M
·2
b22
129-127
-1
· (1 + 1·2
+ 1·2
· (1 + 0,5 + 0,25 + 0,125 + 0)
Big Endian
- High byte,
- Low byte.
MMMMMMMM
Byte 3
-1
-2
-3
+ M
·2
+ M
·2
b21
b20
-2
-3
-4
+ 1·2
+ 0·2
)
32
Little Endian
- Low byte,
- High byte.
MMMMMMMM
Byte 4
-4
+ M
·2
+ ...)
b19