Interface ModbusRegisterElement<T>

    • Method Detail

      • setInputRegisters

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

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

        default java.util.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.

        Returns:
        the next value as an Optional array of Registers
      • getNextWriteValue

        java.util.Optional<com.ghgande.j2mod.modbus.procimg.Register[]> getNextWriteValue()