Diagnosis (Function 8)

The diagnosis function provides a series of tests for checking the communication system between the master and the slave and for examining a variety of internal error states within the slave. A broadcast telegram is not supported.

The function uses two bytes in the query to specify a sub function code defining the test that is to be carried out. The slave returns the function code and the sub function code in the response.

The diagnostic queries use a two-byte data field to send diagnostics data or control information to the slave.

Query

Byte Name

Modbus RTU

Modbus ASCII

Start - Frame

":"

0x3A

Address

11

0x0B

"0B"

0x30, 0x42

Function-Code

8

0x08

"08"

0x30, 0x38

Sub function high

0

0x00

"00"

0x30, 0x30

Sub function low

0

0x00

"00"

0x30, 0x30

Data high

2

0x02

"02"

0x30, 0x32

Data low

3

0x03

"03"

0x30, 0x33

Error Check, LRC/CRC

 

0xA1, 0xC0 

"E8"

0x45, 0x38

End - Frame

 

t1-t2-t3

CRLF

0x0D, 0x0A

Response

Byte Name

Modbus RTU

Modbus ASCII

Start - Frame

":"

0x3A

Address

11

0x0B

"0B"

0x30, 0x42

Function-Code

8

0x08

"08"

0x30, 0x38

Sub function high

0

0x00

"00"

0x30, 0x30

Sub function low

0

0x00

"00"

0x30, 0x30

Data high

2

0x02

"02"

0x30, 0x32

Data low

3

0x03

"03"

0x30, 0x33

Error Check, LRC/CRC

 

0xA1, 0xC0 

"E8"

0x45, 0x38

End - Frame

 

t1-t2-t3

CRLF

0x0D, 0x0A

Echo a request (Sub function 0)

Sub function 0 causes the data that is sent to the slave by the master to be returned.

Coupler reset (Sub function 1)

Sub function 1 re-initializes the BC9000/BK9000. Error counters are reset, and the Bus Terminal Controller executes a self-test. No telegrams are either received or sent while the Bus Terminal Controller is being reset. The IP socket is closed.

Note

Before the Controller will restart, it will send a response with Sub function 1.

Note

The BC8150 support the sub function 0 and 1. All other sub function answer with the value "0".

 

Sub function

Data field (query)

Data field (response)

0x0001

0x0000 

0x0000 

Delete All Counter Contents (Sub function 10)

Calling this sub function deletes the contents of all error counters in the Bus Terminal Controller.

Sub function

Data field (query)

Data field (response)

0x000B

0x0000 

Echo query data

Bus Communication Answer Counter (Sub function 11)

Returns the number of communication answers.

Sub function

Data field (query)

Data field (response)

0x000C

0x0000 

Counter value

Error Answer Counter (Sub function 13)

This counter contains the number of error answer telegrams that the coupler has sent.

Sub function

Data field (query)

Data field (response)

0x000D

0x0000 

Counter value

The following functions contain the counter states for various units. This means that the Modbus telegrams can be distinguished through their units, if, for example, a Bus Coupler is accessed by different masters.

Slave Answers (Sub function 14)

Contains the number of answers that the slave has sent.

Sub function

Data field (query)

Data field (response)

0x000E

0x0000 

Counter value

Number of unanswered telegrams (Sub function 15)

Contains the number of answers that the slave has not sent.

Sub function

Data field (query)

Data field (response)

0x000F

0x0000 

Counter value

Number of Error Answers (Sub function 16)

Contains the number of error answers that the slave has sent.

Sub function

Data field (query)

Data field (response)

0x0010

0x0000 

Counter value