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

Sample

Function code

8

Sub-function high

0

Sub-function low

0

Data high

2

Data low

3

Response

Byte name

Sample

Function code

8

Sub-function high

0

Sub-function low

0

Data high

2

Data low

3

Echo 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 coupler is reset with sub-function 1, error counters are reset and the controller performs a self-test. No telegrams are either received or sent while the controller is being reset. The IP socket is closed.

Diagnosis (Function 8) 1:

Last reply with the sub-function 1

Before the Controller restarts it sends a reply with sub-function 1, after which the IP socket is closed.

Sub-function

Data field (query)

Data field (response)

0x0001

0x0000

0x0000

Delete all counter contents (sub-function 10)

When this sub-function is called the controller clears all error counters.

Sub-function

Data field (query)

Data field (response)

0x000A

0x0000

Echo query data

Bus Communication Answer Counter (Subfunction 11)

Returns the number of communication answers.

Sub-function

Data field (query)

Data field (response)

0x000B

0x0000

Counter value

Error Answer Counter (Subfunction 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 coupler is accessed by different masters.

Slave Answers (Subfunction 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 (Subfunction 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 (Subfunction 16)

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

Sub-function

Data field (query)

Data field (response)

0x0010

0x0000

Counter value