Expand description
Modbus request PDUs. Wrap them in a Frame to give them a
unit ID and CRC.
use async_modbus::zerocopy::IntoBytes;
let pdu = WriteHolding::new().with_register(0x10BC).with_value(12345);
let frame = Frame::new(0x01, pdu);
assert_eq!(frame.as_bytes(), hex!("01 06 10 BC 30 39 98 FC"));Structsยง
- Read
Coils ReadCoilsPDU (function code0x01).- Read
Discrete Inputs ReadDiscreteInputsPDU (function code0x02).- Read
Holdings ReadHoldingsPDU (function code0x03).- Read
Inputs ReadInputsPDU (function code0x04).- Write
Holding WriteHoldingPDU (function code0x06).- Write
Holdings WriteHoldingsPDU (function code0x10).