What are the types of Modbus Error Codes?

Modbus is a communication protocol commonly used in industrial automation systems for communicating data between electronic devices. In Modbus communication, error codes are used to indicate various types of errors that may occur during the communication process. Here are some of the common Modbus error codes:

Illegal Function (01 hex):

  • This error code indicates that the function code received in the query is not recognized or allowed by the slave device.

Illegal Data Address (02 hex):

  • The data address specified in the query is not valid for the slave device. It may be outside the allowable range of addresses or it may not exist.

Illegal Data Value (03 hex):

  • The value contained in the query’s data field is not valid for the slave device. This could be due to a data conversion error or an invalid value for the specified data type.

Server Failure (04 hex):

  • The slave device encountered a failure while attempting to perform the requested action. This could be due to internal hardware or software issues.

Acknowledge (05 hex):

  • The slave device received the request and is processing it, but it needs more time to complete the operation. This is often used in situations where the operation requires significant processing time.

Slave Device Busy (06 hex):

  • The slave device is unable to perform the requested operation because it is busy processing another request. The master should retry the request after a short delay.

Memory Parity Error (08 hex):

  • This error indicates a parity error in the memory of the slave device. It typically indicates a hardware fault that requires attention.

Gateway Path Unavailable (0A hex):

  • This error is returned by a gateway device if it cannot establish a connection to the target device or if the target device is not responding.

Certainly! Here are a few more Modbus error codes:

Gateway Target Device Failed to Respond (0B hex):

  • This error code is returned by a gateway device when it sends a request to a target device, but the target device fails to respond within the specified timeout period.

Broadcast Failed (0F hex):

  • This error occurs when a slave device receives a broadcast message but cannot perform the requested action. Broadcast messages are sent to all devices on the network, and some devices may not support certain types of broadcast requests.

Checksum Error (10 hex):

  • The checksum field in the Modbus message does not match the calculated checksum value. This indicates that the message may have been corrupted during transmission.

Invalid Slave ID (11 hex):

  • The slave address specified in the message does not correspond to any slave devices on the network. This could be due to a misconfiguration or a physical connection issue.

Invalid Function Code for Write (14 hex):

  • This error code occurs when a master device attempts to write data to a slave device using a function code that is not supported for write operations.

Response Overrun (15 hex):

  • The response from the slave device is longer than expected, and the master device’s buffer is unable to accommodate the entire response. This typically occurs when the master device expects a shorter response than what the slave device sends.

Certainly! Here are a few more Modbus error codes:

Device Busy (18 hex):

  • The device is busy processing a long-duration command, and it cannot accept new requests at the moment.

Negative Acknowledgment (21 hex):

  • The slave device received the request but cannot perform the requested action. This error code is also known as NAK.

Memory Parity Error (80 hex):

  • This error indicates a parity error in the memory of the slave device. It typically indicates a hardware fault that requires attention.

Gateway Target Device Failed to Respond (0B hex):

  • This error code is returned by a gateway device when it sends a request to a target device, but the target device fails to respond within the specified timeout period.

Gateway Path Unavailable (0A hex):

  • This error is returned by a gateway device if it cannot establish a connection to the target device or if the target device is not responding.

Timeout (A0 hex):

  • The response from the slave device did not arrive within the specified timeout period. This can happen due to communication issues or device failures.

Certainly! Here are a few more Modbus error codes:

Gateway Target Device Failed to Respond (0B hex):

  • This error code is returned by a gateway device when it sends a request to a target device, but the target device fails to respond within the specified timeout period.

File Record Not Found (14 hex):

  • This error occurs when attempting to access a file record that does not exist or is not available on the slave device.

File Record Contains Wrong Data (15 hex):

  • The file record data received from the slave device is not as expected or contains incorrect information.

Function Code Not Supported (22 hex):

  • The function code specified in the Modbus message is not supported by the slave device. This could be due to limitations of the device or misconfiguration.

Parameter Value Invalid (23 hex):

  • The parameter value supplied in the request is not valid. This could be due to out-of-range values or unsupported parameters.

Operation Failure (24 hex):

  • The requested operation failed for an unspecified reason. This error code is a generic indication of failure.

Device Communication Error (25 hex):

  • There was a communication error between the master and slave devices. This could be due to electrical noise, cable issues, or other communication problems.

Hardware Failure (26 hex):

  • The slave device encountered a hardware failure while attempting to process the request. This could include issues such as power supply failure or component malfunction.

These additional error codes provide further insight into the various issues that may arise during Modbus communication, helping operators and engineers diagnose and resolve problems effectively.