Structure of the data blocks

 

All data blocks use the same structure:

 

 

Data structure

 

 

 

 

Slave address

Function code

Data field

Checksum CRC16

 

1 byte

1 byte

x byte

2 bytes

Every data block contains 4 fields:

 

Slave address

Device address of a certain slave

 

 

 

 

 

Function code

Function selection (reading or writing words)

 

 

 

 

 

Data field

Contains the following information:

 

 

 

 

 

 

 

 

-

Word address

 

 

 

 

 

 

 

 

 

 

 

 

 

-

Number of words

 

 

 

 

 

 

 

 

 

 

 

 

 

-

Word value

 

 

 

 

 

 

 

 

 

 

Checksum

Identification of transmission errors

 

 

 

 

Fault handling

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Error codes

3 different error codes are used:

 

 

 

 

 

 

 

 

 

 

1

Invalid function

 

 

 

 

 

 

 

 

 

 

 

 

 

2

Invalid parameter address

 

 

 

 

 

 

 

 

 

 

8

Write access to parameter rejected

 

 

 

 

 

 

 

 

 

Reply in the event

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Slave address

 

Function

 

 

Error code

Checksum CRC16

 

of fault

 

 

 

 

 

XX OR 80 h

 

 

 

 

 

 

 

 

 

 

 

1 byte

 

 

1 byte

 

 

 

1 byte

 

2 bytes

 

 

The function code is OR linked with 0 x 80, that is, the MSB (most significant bit) will be

 

 

set to 1.

 

 

 

 

 

 

 

 

 

 

 

 

 

Example

Data query:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

01

 

02

 

00

 

70

 

00

 

04

 

CRC16

 

 

Reply:

 

 

 

 

 

 

 

 

 

 

 

 

 

01

82

01

CRC16

Special cases

In the following cases, the slave does not reply:

 

- The checksum (CRC16) is wrong

 

-

The instruction given by the master is incomplete or overdefined

 

-

The number of words or bits to be read is zero

 

5/14

 

 

Siemens Building Technologies

CC1A7865.1en

HVAC Products

31.10.2002

Page 5
Image 5
Siemens RS-485 manual Slave address, Function code, Data field, Checksum, Fault handling