beautypg.com

K-Patents SeedMaster 2 User Manual

Page 81

background image

11 COMMUNICATION

81

81

25 00 00 00 00 1B 15

header, ID = 15 (hex)

03

command code (READ)

18

number of bytes = 18 (hex) = 24 (dec)

6B 85 42 9D 85 1F

data (24 (dec) bytes)

42 8B 97 ED 44 B7

1B (hex) = 27 (dec) 6E CC 42 AC 00 00
bytes follow 00 00 00 00 00 00

18 (hex) bytes

Client’s request to WRITE REGISTERS:

0F 00 00 00 00 0E 15 10 00 80 04 08 80 00 42 9E 8A 3D 42 8D

complete message

0F 00 00 00 00 0E 15

header, SeedMaster 2 ID = 15

10

command code (WRITE)

00 80

register base address

04

number of registers

08

number of bytes

80 00 42 9E 8A 3D 42 8D

data

The Client requests writing the 8 data bytes in the registers of SeedMaster 2 with MODBUS address 15 (hex)
starting from base address 0080 (hex).

SeedMaster 2 will acknowledge the request with the following message:

0F 00 00 00 00 06 15 10 00 80 00 04

complete message

0F 00 00 00 00 06 15

header, SeedMaster 2 ID = 15

10

command code (WRITE)

00 80

register base address

00 04

number of registers


Numbers in the MODBUS registers

Storage of data in the MODBUS registers: Hbyte Lbyte

WORD data

This type of data is stored in 2 bytes (16 bits). There is no sign stored and the range is 0 – 65535.

MODBUS

REGISTER

HIGH byte

LOW byte

Most Significant Bit

Least Significant Bit

15

0

FLOATING POINT data

Floating point data in SeedMaster 2 comply with the IEEE 754 / 1985 SHORT REAL (SINGLE PRECISION)
format specification. The number consists of 3 parts:

sign,

exponent and

mantissa,

which are stored in 4 bytes. Consequently, storage of floating point numbers requires 2 MODBUS registers.

High address MODBUS register

Low address MODBUS register

High byte Low byte

High byte Low byte

S Exponent

Mantissa

31 30 23 22

0

The value of the sign bit S is 0, if the number is positive, and 1, if it is negative. Due to the fact that the
numbers do not use the 2-s complement notation, + 0 and – 0 are also represented.
The Mantissa is stored in normalized form which means that:

bit 22 = 2

-1

, bit 21 = 2

-2

, … , and bit 0 = 2

-23

.