Interface ModbusRegisterElement<T>

All Superinterfaces:
All Known Implementing Classes:
AbstractDoubleWordElement, AbstractModbusRegisterElement, AbstractQuadrupleWordElement, AbstractWordElement, BitsWordElement, DummyRegisterElement, FloatDoublewordElement, FloatQuadruplewordElement, SignedDoublewordElement, SignedQuadruplewordElement, SignedWordElement, StringWordElement, UnsignedDoublewordElement, UnsignedQuadruplewordElement, UnsignedWordElement

public interface ModbusRegisterElement<T> extends ModbusElement<T>
A ModbusRegisterElement represents one or more Modbus Registers.
  • Method Details

    • setInputRegisters

      void setInputRegisters(com.ghgande.j2mod.modbus.procimg.InputRegister... registers) throws OpenemsException
      Sets the value of this Element from InputRegisters.
      registers - the InputRegisters
      OpenemsException - on error
    • setNextWriteValue

      default void setNextWriteValue(Optional<Object> valueOpt) throws OpenemsException, IllegalArgumentException
      Sets a value that should be written to the Modbus device.
      valueOpt - the Optional value
      OpenemsException - on error
      IllegalArgumentException - on error
    • getNextWriteValueAndReset

      default Optional<com.ghgande.j2mod.modbus.procimg.Register[]> getNextWriteValueAndReset()
      Gets the next write value and resets it.

      This method should be called once in every cycle on the TOPIC_CYCLE_EXECUTE_WRITE event. It makes sure, that the nextWriteValue gets initialized in every Cycle. If registers need to be written again in every cycle, next setNextWriteValue()-method needs to called on every Cycle.

      the next value as an Optional array of Registers
    • getNextWriteValue

      Optional<com.ghgande.j2mod.modbus.procimg.Register[]> getNextWriteValue()
      Gets the next write value.
      the next value as an Optional array of Registers