Skip to main content

validate_read_write_registers

Function validate_read_write_registers 

Source
pub fn validate_read_write_registers(
    read_address: u16,
    read_quantity: u16,
    write_address: u16,
    write_quantity: u16,
    write_byte_count: u8,
) -> Result<(), ExceptionCode>
Expand description

Validate a read/write multiple registers (FC 17) request.

Per spec §6.17 Figure 27 state diagram.

§Errors

  • IllegalDataValue if quantities out of range or byte count doesn’t match
  • IllegalDataAddress if either address+quantity overflows