pub enum RequestPacketError {
RequestTooBig,
ResponseWillTooBig,
CannotBroadcast,
}Expand description
Errors that can occur while building a Modbus RTU request packet.
Variants§
RequestTooBig
This error is raised when the function tries to produce a request packet that exceeds the Modbus RTU protocol’s maximum packet length of 256 bytes.
Requests that attempt to write too many values at once will exceed the 256-byte limit of the request packet.
If you intentionally need to bypass the request packet length limit, enable the Cargo feature as shown below.
§Warning: packets produced with this feature enabled may fail during communication.
[dependencies]
modbus-rtu = { version = "1.0", features = ["unlimited_packet_size"] }ResponseWillTooBig
This error is raised when the expected response packet would exceed the Modbus RTU protocol’s maximum packet length of 256 bytes.
If you intentionally need to bypass the response packet length limit, enable the Cargo feature as shown below.
§Warning: packets produced with this feature enabled may fail during communication.
[dependencies]
modbus-rtu = { version = "1.0", features = ["unlimited_packet_size"] }CannotBroadcast
This error occurs when attempting to broadcast a function that does not support broadcasting (e.g., 0x01, 0x03).
If you intentionally need to broadcast such functions, enable the Cargo feature as shown below.
§Warning: packets produced with this feature enabled may fail during communication.
[dependencies]
modbus-rtu = { version = "1.0", features = ["enforce_broadcast"] }Trait Implementations§
Source§impl Clone for RequestPacketError
impl Clone for RequestPacketError
Source§fn clone(&self) -> RequestPacketError
fn clone(&self) -> RequestPacketError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more