Class AbstractDoubleWordElement<E,​T>

    • Constructor Detail

      • AbstractDoubleWordElement

        public AbstractDoubleWordElement​(OpenemsType type,
                                         int startAddress)
    • Method Detail

      • getLength

        public final int getLength()
        Description copied from interface: ModbusElement
        Number of Registers or Coils.
        Returns:
        the number of Registers or Coils
      • fromByteBuffer

        protected abstract T fromByteBuffer​(java.nio.ByteBuffer buff)
        Converts a 4-byte ByteBuffer to the the current OpenemsType.
        Parameters:
        buff - the ByteBuffer
        Returns:
        an instance of the given OpenemsType
      • _setNextWriteValue

        public final void _setNextWriteValue​(java.util.Optional<T> valueOpt)
                                      throws OpenemsException
        Description copied from interface: ModbusElement
        Sets a value that should be written to the Modbus device.
        Parameters:
        valueOpt - the Optional value
        Throws:
        OpenemsException - on error
      • toByteBuffer

        protected abstract java.nio.ByteBuffer toByteBuffer​(java.nio.ByteBuffer buff,
                                                            T value)
        Converts the current OpenemsType to a 4-byte ByteBuffer.
        Parameters:
        buff - the target ByteBuffer
        value - an instance of the given OpenemsType
        Returns:
        the ByteBuffer
      • wordOrder

        public final E wordOrder​(WordOrder wordOrder)
        Sets the Word-Order. Default is "MSWLSW" - "Most Significant Word; Least Significant Word". See http://www.simplymodbus.ca/FAQ.htm#Order.
        Parameters:
        wordOrder - the new Word-Order
        Returns:
        myself