Diagnostics, Echoes a query (sub-function 0) – BECKHOFF BK7300 User Manual
Page 33
MODBUS
BK7300
29
Byte Name
Example
RTU
ASCII
Start frame
„:“
0x3A
Slave address 11
0x0B
„0B“
0x30, 0x42
Function code 23
0x17
„17“
0x31, 0x37
Byte Count 4
0x04
„04“
0x30, 0x34
Data 1 high 0
0x00
„00“
0x30, 0x30
Data 1 low 56
0x38
„38“
0x33, 0x38
Data 2 high 63
0x3F
„3F“
0x33, 0x46
Data 2 low 11
0x0B
„0B“
0x30, 0x42
Error Check
LRC / CRC
0x82
0xDD
„58“
0x35, 0x38
End of frame
t1-t2-t3
CRLF
0xD, 0xA
Diagnostics
In the Modbus, function 08 provides a series of tests for examination of the
communication system between the master and the slave and for
inspection of a variety of internal error states within the slave. A broadcast
telegram is not supported.
The function uses a two-byte sub-function code field in the query to define
the test that is to be carried out. The slave outputs the function code and
the sub-function code as an answer.
The diagnostic queries use a two-byte data field to send diagnostics data
or control information to the slave.
EXAMPLE Query
Byte Name
Example
RTU
ASCII
Start frame
„:“
0x3A
Slave 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 of frame
t1-t2-t3
CRLF
0xD, 0xA
Response
Byte Name
Example
RTU
ASCII
Start frame
„:“
0x3A
Slave 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 of frame
t1-t2-t3
CRLF
0xD, 0xA
Echoes a query (Sub-Function 0)
Sub-function 0 causes the data that is sent to the slave by the master to be
returned.