Class AbstractQuadrupleWordElement<E,​T>

    • Constructor Detail

      • AbstractQuadrupleWordElement

        public AbstractQuadrupleWordElement​(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 8-byte ByteBuffer to the current OpenemsType.
        Parameters:
        buff - the ByteBuffer
        Returns:
        an instance of the current 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 8-byte ByteBuffer.
        Parameters:
        buff - the target ByteBuffer
        value - the value
        Returns:
        the ByteBuffer
      • wordOrder

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