Interface ModbusFunction

All Known Implementing Classes:
ModbusReadFunction, ModbusWriteFunction

public interface ModbusFunction
API for a modbus function.
Since:
2.5
Version:
2.1
Author:
matt
  • Method Details

    • getCode

      int getCode()
      Get the function code.
      Returns:
      the code
    • toDisplayString

      String toDisplayString()
      Get a friendly display string for this function.
      Returns:
      a display string
    • isReadFunction

      boolean isReadFunction()
      Return true if this function represents a read operation.
      Returns:
      true if this function represents a read operation, false if a write operation
    • oppositeFunction

      ModbusFunction oppositeFunction()
      Get an "opposite" function from this function.

      This method is used to get a read function for a given write function, and a write function for a given read function.

      Returns:
      the function, or null if not applicable
    • blockType

      Get the register block type related to this function.
      Returns:
      the block type
      Since:
      2.1
    • functionForCode

      static ModbusFunction functionForCode(int code)
      Get a ModbusFunction for a code value.
      Parameters:
      code - the code
      Returns:
      the function
      Throws:
      IllegalArgumentException - if code is not supported
      Since:
      2.0