Interface ModbusCoilElement

    • Method Detail

      • setInputCoil

        void setInputCoil​(java.lang.Boolean coil)
                   throws OpenemsException
        Sets the boolean value of this Element from Modbus Coil.
        Parameters:
        coil - the value
        Throws:
        OpenemsException - on error
      • setNextWriteValue

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

        default java.util.Optional<java.lang.Boolean> 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 Optional next write value
      • getNextWriteValue

        java.util.Optional<java.lang.Boolean> getNextWriteValue()
        Gets the next write value.
        Returns:
        the Optional next write value