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 |
Example |
---|---|
Function code |
8 |
Sub function high |
0 |
Sub function low |
0 |
Data high |
2 |
Data low |
3 |
Response
Byte Name |
Example |
---|---|
Function code |
8 |
Sub function high |
0 |
Sub function low |
0 |
Data high |
2 |
Data low |
3 |
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 Bus Terminal Controller restarts it sends one more answer 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)
Calling this sub function deletes the contents of all error counters in the Bus Terminal Controller.
Sub function |
Data field (query) |
Data field (response) |
---|---|---|
0x000A |
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) |
---|---|---|
0x000B |
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 |