Class ModbusConstants

java.lang.Object
org.openhab.core.io.transport.modbus.ModbusConstants

@NonNullByDefault public class ModbusConstants extends Object
Constants for Modbus transport == Regarding maximum read and write limits == Maximum number of registers that are allowed to be read. The Modbus protocol has many intepretation on maximum data size of messages. Good reference is here. We try to follow modern specification here (V1.1B3). See section 4.1 Protocol Specification in the specification. According to V1.1B3, maximum size for PDU is 253 bytes, making maximum ADU size 256 (RTU) or 260 (TCP). In the spec section 6, one can see maximum values for read and write counts. Note that this is not the only interpretation -- some sources limit the ADU to 256 also with TCP. In some cases, slaves cannot take in so much data. Reads are limited by response PDU size. Writes (FC15 and FC16) are limited by write request ADU size.
Author:
Sami Salonen - Initial contribution
  • Field Details

    • MAX_BITS_READ_COUNT

      public static final int MAX_BITS_READ_COUNT
      Maximum number of coils or discrete inputs that are allowed to be read. Limitation by Modbus protocol V1.1B3, 6.1 definition of Read Holding registers.
      See Also:
    • MAX_REGISTERS_READ_COUNT

      public static final int MAX_REGISTERS_READ_COUNT
      Maximum number of registers that are allowed to be read. Limitation by Modbus protocol V1.1B3, 6.3 definition of Read Coils.
      See Also:
    • MAX_BITS_WRITE_COUNT

      public static final int MAX_BITS_WRITE_COUNT
      Maximum number of coils or discrete inputs that are allowed to be written. Limitation by Modbus protocol V1.1B3, 6.11 definition of Write Multiple coils.
      See Also:
    • MAX_REGISTERS_WRITE_COUNT

      public static final int MAX_REGISTERS_WRITE_COUNT
      Maximum number of registers that are allowed to be written. Limitation by Modbus protocol V1.1B3, 6.12 definition of Write Multiple registers.
      See Also:
  • Constructor Details

    • ModbusConstants

      public ModbusConstants()