Effective Function Code Description (Decimal)
| function code | Instructions |
|---|---|
| 01 | Read coil status |
| 02 | Read input status |
| 03 | Read and hold register |
| 04 | Read input register |
| 05 | Strong single coil |
| 06 | Pre set single register |
| 07 | Read abnormal status |
| 08 | Return diagnostic verification |
| 09 | Programming (Only for484) |
| 10 | Control inquiry |
| 11 | Read event count |
| 12 | Read communication event records |
| 13 | Programming (184/384/484/584Etc.) |
| 14 | explore |
| 15 | Strong placement of multiple coils |
| 16 | Pre set multiple coils |
| 17 | Report multiple registers |
| 18 | Can enable the host to simulate programming functions |
| 19 | Reset communication link |
| 20 | Read general parameters |
| 21 | Write universal parameters |
| 22 | Mask write register |
| 23 | Read/write multiple registers |
| 43 | Read device identification code |
| 22-42, 44-64 | Reserved as an extended feature |
| 65-72 | Reserved for backup use |
| 73-119 | Illegal function |
| 120-127 | Reserve, Reserved for internal use |
| 128-255 | Reserve, Used for abnormal response |
Exception Response
master device (client) Or from the device (Server) Any abnormality in the response should occur, All of them can lead to data processing errors. On the main device (client) After making a request, One of the following events may occur:
- If from the device (Server) From the main device (client) Received request, There were no communication errors among them, And processed the request correctly, So it will return a normal response.
- If from the device (Server) Due to a communication error, it was not connected to the main device (client) Receive requests, So it won't return to Shangying. The main device program will eventually process a timeout condition for the request.
- If from the device (Server) From the main device (client) Received request, But a communication error was detected, So it won't return to Shangying. The main device program will eventually process a timeout condition for the request.
- If from the device (Server) From the main device (client) Received request, There were no communication errors among them, But I can't handle it (For example, the request is to read a non-existent register) , So the device will return an abnormal response, Notify the main device of any errors that have occurred.
Abnormal frame
An exception frame was sent from the device to the master device, Report abnormal response. An abnormal frame includes four domains:
| domain | definition | size | Instructions |
|---|---|---|---|
| 1 | From device number | 1 bytes | The destination address of the request1–247: Unique destination address |
| 2 | Abnormal function code | 1 bytes | RequestFunction code +128 (0x80) |
| 3 | Exception code | n byte | Refer to the next section |
| 4 | Check | 2 byte | CRC16 (Check for transmission errors) |
Exception code
Abnormal response frames have two fields that distinguish them from regular response frames:
- The abnormal response function code is equal to the original request function code plus 128 (0x80).
- The exception code depends on the communication error encountered by the device.
The table below introduces the exception codes handled by circuit breakers:
| Exception code | Name | Instructions |
|---|---|---|
| 01 (0x01) | Illegal function | The function code received in the request is not an authorized operation from the device. The device may be in an incorrect state, Unable to process specific requests. |
| 02 (0x02) | Illegal data address | The data address received from the device is not an authorized address of the device. |
| 03 (0x03) | Illegal data value | The value in the request data column is not an authorized value from the device. |
| 04 (0x04) | From equipment failure | Failed to execute a requested operation from the device, Because an irreparable error occurred. |
| 05 (0x05) | Confirm | Received request from device, But it takes a long time to process it. |
| 06 (0x06) | Busy with devices | The device is busy processing another command. The master device must send a request after the slave device is idle. |
| 07 (0x07) | Negative confirmation | The slave device is unable to execute the programming request sent by the master device. |
| 08 (0x08) | Memory parity check error | Detected a parity error from the storage when attempting to read the expansion memory from the device. |
| 10 (0x0A) | Gateway channel unavailable | Gateway overload, Or not configured correctly. |
| 11 (0x0B) | Gateway target device failed to respond | There is no slave device in the network. |
Leave a Reply