pub enum Exception {
IllegalFunction,
IllegalDataAddress,
IllegalDataValue,
ServerDeviceFailure,
Acknowledge,
ServerDeviceBusy,
MemoryParityError,
GatewayPathUnavailable,
GatewayTargetFailedToRespond,
}Expand description
A Modbus exception code: the reason a device gives for refusing a request.
A device that cannot serve a request replies with the request’s function code with
its high bit set, followed by one of these codes. Adu::exception
and Response::exception surface it.
§Examples
use pamoja_modbus::Exception;
assert_eq!(Exception::IllegalDataAddress.code(), 0x02);
assert_eq!(Exception::from_code(0x01), Some(Exception::IllegalFunction));Variants§
IllegalFunction
The function code is not allowed for this device. Exception code 0x01.
IllegalDataAddress
The data address is not allowed for this device. Exception code 0x02.
IllegalDataValue
A value in the request is not allowed for this device. Exception code 0x03.
ServerDeviceFailure
The device failed while serving the request. Exception code 0x04.
Acknowledge
The device accepted a long-running request and is still processing it. Exception code 0x05.
ServerDeviceBusy
The device is busy with a long-running request; retry later. Exception code 0x06.
MemoryParityError
The device detected a parity error in its memory. Exception code 0x08.
A gateway could not route the request to the target path. Exception code 0x0A.
GatewayTargetFailedToRespond
A gateway reached the target device but got no response. Exception code 0x0B.