beautypg.com

KROHNE OPTISONIC V6 Modbus User Manual

Page 13

background image


2011-07-19

OPTISONIC_V6_Modbus_6.doc

13/29

K

R

O

H

N

E

C

T

P

ro

d

u

c

ts

6.2

Long integer (32 bit), Transmit Sequence

Example

Long integer value 305419896 (12345678 hexadecimal).

Long integers

could be transmitted in two possible ways. The transmit order in both modes:

Normal mode

(1)

12

h

(2)

34

h

(3)

56

h

(4)

78

h

Reversed mode

(3)

56

h

(4)

78

h

(1)

12

h

(2)

34

h

6.3

Single precision floating-point (32 bit), Transmit Sequence

Single precision floating-point numbers are stored in 32-bit registers, represented using the IEEE 754
encoding. In IEEE 754-2008 the 32-bit base 2 format is officially referred to as

binary32

. It was called

single

in IEEE 754-1985.

The IEEE 754 standard specifies a binary32 as having:

Sign bit: 1 bit

Exponent width: 8 bits

Significand (also known as mantissa) precision: 24 (23 explicitly stored)

The true significand (mantissa) includes an implicit leading bit with value 1 unless the exponent is stored with
all zeros. Thus only 23 bits of the significand (mantissa) appear in the memory format but the total precision
is 24 bits (equivalent to log10(2

24

) ≈ 7.225 decimal digits). The bits are laid out as follows:

Sign + (Biased) Exponent

Exponent + Mantissa 3 (high)

Mantissa 2

Mantissa 1 (low)

SEEE EEEE

E MMM MMMM

MMMM MMMM

MMMM MMMM

The single precision binary floating-point exponent is encoded using an offset binary representation, with the
zero offset being 127; also known as exponent bias in the IEEE 754 standard.

Example:

The float number 4.125977 will give the IEEE 754representation.

Sign

Exponent

Mantissa

0

1000 0001

(1) 000 0100 0000 1000 0000 0000

A positive sign
A biased exponent of 129 (81 hexadecimal) is exponent 2.
Mantissa = 4 + 1/8 + 1/1024. Note that the first bit is not stored!

Floats

could be transmitted in two ways. The transmit order in both modes:

IEEE 754

(1)

40

h

(2)

84

h

(3)

08

h

(4)

00

h

Normal mode

(1)

40

h

(2)

84

h

(3)

08

h

(4)

00

h

Reversed mode

(3)

08

h

(4)

00

h

(1)

40

h

(2)

84

h

6.4

Double precision floating-point (64 bit), Transmit Sequence

Double precision floating-point numbers are stored in 64-bit registers, represented using the IEEE 754
encoding. In IEEE 754-2008 the 64-bit base 2 format is officially referred to as

binary64

. It was called

double

in IEEE 754-1985.