PM 1000288 000 00
Device handbook SIRAX BT5100
31/32
Example of set slave address to 2
Query:
Device address
Function code
Start address
Nr. of register
Nr. of bytes
Databytes 0...3
CRC
0x01
0x10
0x000E
0x0002
0x04
0x40000000
0x67E3
Response:
Device address
Function code
Start address
Nr. of register
CRC
0x01
0x10
0x000E
0x0002
0x200B
Exception Cases: An exception code will be generated when BT5100 receives ModBus query with valid parity and error check but which contains
some other error ( e.g. Attempt to set fl oating point variable to an invalid value). The response generated will be “Function code” + 0x80.
01
Illegal function
The function code is not supported.
02
Illegal data address
Attempt to access an invalid address or an attempt to read or write part of a
fl oating point value.
03
Illegal data value
Attempt to set a fl oating point variable to an invalid value.
11.2 Data types
All information are displayed as 32-bit fl oat. There is no representation for fl oating point numbers in the Modbus specifi cation. But as a matter of
principle any desired data structure can be casted to a sequence of 16Bit registers.
The IEEE 754 standard as the most often used standard for the representation of fl oating numbers is applied.
•
The fi rst register contains the bits 16 – 31
•
The second register contains the bits 0 – 15
32-Bit Float (Real32)
31
30
23
22 0
exponent
mantissa
sign
0x4861
0xD2F0
0
1
0
0
1
0
0
0
0
1
1
0
0
0
0
1
1
1
0
1
0
0
1
0
1
1
1
1
0
0
0
0
+
exponent: 144-127=
17
mantissa=1.01001000011000011101001011110000=
1.76424980163574226410992
Measuring value U = 1.76424980163574226410992 * 2
17
= 231243.75 V