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

Page 5

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

Image 5
Contents 31.10.2002 Master-slave principleDevice address Transmission mode RTUNot Reply by the slave Communication sequenceBaud rate 600 813 19.200 406Time sequence Data query sequenceCommunication during the slave’s internal handling time Communication during the slave’s response timeSlave address Fault handlingFunction code Data fieldCRC = SHR CRC Checksum CRC16Reply CRC16 = Following functions for the device will be availableWriting 1 word Reading n wordsWriting n words Instruction Example Write switch-on threshold Hys1 = Word address =Reply AddressAddress tables Address Data Access Parameter Value range DefaultAccess Parameter REM TempRoff SetpointDevice state Address Data type Access ParameterRemote RK1 Description of operating modes«FULLY REMOTE» SPR Operating mode Control strategy for Dependent switchingFloating output with Modulating burner