GN-9371_2_3 User Manual
Page 88 of (110)
G-series GN-9371_2_3 PIO Rev. 1.02.docx
A.3.7 (0x08) Diagnostics
MODBUS function code 08 provides a series of tests for checking the communication system between a
client (Master) device and a server (Slave), or for checking various internal error conditions within a server.
The function uses a two–byte sub-function code field in the query to define the type of test to be performed.
The server echoes both the function code and sub-function code in a normal response. Some of the
diagnostics cause data to be returned from the remote device in the data field of a normal response.
•
Request
Field name
Example
RTU
Start of Frame
-
t1-t2-t3
Slave Address
0x07
0x07
Function Code
0x08
0x08
Sub-Function Hi
0x00
0x00
Sub-Function Lo
0x00
0x00
Data Hi
0x11
0x11
Data Lo
0x22
0x22
Error Check (CRC/LRC)
-
0x6C, 0x24
End of Frame
-
t1-t2-t3
•
Response
Field name
Example
RTU
Start of Frame
-
t1-t2-t3
Slave Address
0x07
0x07
Function Code
0x08
0x08
Sub-Function Hi
0x00
0x00
Sub-Function Lo
0x00
0x00
Data Hi
0x11
0x11
Data Lo
0x22
0x22
Error Check (CRC/LRC)
-
0x6C, 0x24
End of Frame
-
t1-t2-t3
Sub-function 0x0000(0) Return Query Data
The data passed in the request data field is to be returned (looped back) in the response.
The entire response message should be identical to the request.
Sub-function
Data Field (Request)
Data Field (Response)
Description
0x0000(0)
Any
Echo Request Data
Sub-function 0x0001(1) Restart Communications Option
The remote device could be initialized and restarted, and all of its communications event counters are
cleared. Especially, data field 0x55AA makes the remote device to restart with factory default setup of
EEPROM.
Sub-
function
Data Field (Request)
Data Field (Response)
Description
0x0001(1)
0x0000, 0xFF00
Echo Request Data
Reset
0x0001(1)
0x55AA
Echo Request Data
Reset with Default setting
1)
0x0001(1)
sumcheck
4)
Echo Request Data
Reset with Factory Default
2)
0x0001(1)
sumcheck
4)
Echo Request Data
Reset with Factory Default
3)
1),2),3) All expansion slot configuration parameters are cleared.
2),3) IP address, Subnet Mask Address, Gateway Address, RS232/485 setting, and BootP/DHCP mode will be the factor
default value
3) Mac address will be the factory default value