Function 8: Diagnosis

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 in the query uses a subfunction code field of two bytes to define the type of test to be carried out. The slave outputs the function code and the subfunction code in a response.
The diagnostics 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

Subfunction high

0

0x00

"00"

0x30, 0x30

Subfunction 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

Subfunction high

0

0x00

"00"

0x30, 0x30

Subfunction 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

Mirroring a request (subfunction 0)

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

Coupler Reset (Subfunction 1)

The Bus Coupler/Fieldbus Box is reinitialized with subfunction 1, error counters are reset, and the Bus Coupler/Fieldbus Box carries out a self-test. During the time, in which the Bus Coupler/Fieldbus Box is reset, no telegrams are received or sent.

Function 8: Diagnosis 1:

Response with subfunction 1

Before the Bus Terminal Controller restarts, it sends a response with subfunction 1.

Function 8: Diagnosis 2:

Subfunctions 0 and 1

The BC8150 has subfunctions 0 and 1 implemented. All other subfunctions return "0".

Subfunction

Data field (query)

Data field (response)

00 01

00 00

00 00

Delete all counter contents (Subfunction 10)

If this subfunction is called, the Bus Coupler/Fieldbus Box deletes all error counters.

Subfunction

Data field (query)

Data field (response)

00 0B

00 00

Echo query data

Bus communication response counter (subfunction 11)

Returns the number of communication answers.

Subfunction

Data field (query)

Data field (response)

00 0C

00 00

Counter value

CRC error counter (subfunction 11)

Indicates the number of detected CRC errors

Subfunction

Data field (query)

Data field (response)

00 0D

00 00

Counter value

Error response counter (subfunction 13)

This counter indicates the number of error response telegrams, which the Bus Coupler/Fieldbus Box has sent.

Subfunction

Data field (query)

Data field (response)

00 0D

00 00

Counter value

The following functions contain the counter states for various units. This means that the Modbus telegrams can be distinguished through units, for example when the Bus Coupler/Fieldbus Box is accessed from different masters.

Slave responses (subfunction 14)

Contains the number of answers that the slave has sent.

Subfunction

Data field (query)

Data field (response)

00 0E

00 00

Counter value

Number of unanswered telegrams (subfunction 15)

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

Subfunction

Data field (query)

Data field (response)

00 0F

00 00

Counter value

Number of error responses (subfunction 16)

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

Subfunction

Data field (query)

Data field (response)

00 10

00 00

Counter value