K-Patents SeedMaster 2 User Manual

Page 80

Advertising
background image

11 COMMUNICATION

80

80

Response:

A

F

RAH

RAL

RNH

RNL

Notation:

A

SeedMaster 2 address (station address)

F

command code

RAH, RAL

base address of MODBUS registers,

RAH: high, RAL: low address byte

RNH, RNL

number of MODBUS registers,

RNH: high, RNL: low byte of the number

BN

number of data bytes sent (0…255)

D1…Dn

data bytes, n=number of registers*2,

high byte first

Length of a MODBUS register:

2 bytes


The MODBUS /TCP messages consist of 3 parts:

• Header (7 bytes)
• Command code (1 byte)

• Data bytes


Header structure:

Field name

Length

Description

Client

Server

Transaction ID 2 bytes

MODBUS

Set by the Copies the ID

transaction

Client

set by the Client

identity

in the response

Protocol ID

2 bytes

0 = MODBUS

Set by the Copies the ID
Client

set by the Client
in the response

Length

2 bytes

Number of the

Set by the Set by the

bytes which

Client

Server

follow

(Request) (Response)

Device ID

1 byte

Identity of the

Set by the Copies the ID

serial line, or

Client

set by the Client

Ethernet device

in the response

Transmission example:

The numbers shown are hexadecimal without spaces (the spaces inserted below are only to make reading
easier).

Client’s request to READ REGISTERS:

25 00 00 00 00 06 15 03 00 00 00 0C

complete message

25 00 00 00 00 06 15

header, SeedMaster 2 ID = 15(hex) = 21 (decimal)

03

command code (READ)

00 00

register base address

00 0C

number of registers = 0C (hex) = 12 (decimal)


6 bytes

SeedMaster 2 response:

25 00 00 00 00 1B 15 03 18 6B 85 42 9D 85 1F 42 8B 97 ED 44 B7 6E CC 42 AC 00 00 00 00 00 00 00 00

Advertising