Class AbstractMultipleWordsElement<SELF extends AbstractModbusElement<SELF,com.ghgande.j2mod.modbus.procimg.Register[],T>,T>

java.lang.Object
io.openems.edge.bridge.modbus.api.element.ModbusElement
io.openems.edge.bridge.modbus.api.element.AbstractModbusElement<SELF,com.ghgande.j2mod.modbus.procimg.Register[],T>
io.openems.edge.bridge.modbus.api.element.ModbusRegisterElement<SELF,T>
io.openems.edge.bridge.modbus.api.element.AbstractMultipleWordsElement<SELF,T>
Type Parameters:
SELF - the subclass of myself
T - the OpenEMS type
Direct Known Subclasses:
AbstractDoubleWordElement, AbstractQuadrupleWordElement, DummyRegisterElement, StringWordElement

public abstract class AbstractMultipleWordsElement<SELF extends AbstractModbusElement<SELF,com.ghgande.j2mod.modbus.procimg.Register[],T>,T> extends ModbusRegisterElement<SELF,T>
A WordElement has a size of one Modbus Registers or 16 bit.
  • Constructor Details

    • AbstractMultipleWordsElement

      protected AbstractMultipleWordsElement(OpenemsType type, int startAddress, int length)
  • Method Details

    • registersToValue

      protected final T registersToValue(com.ghgande.j2mod.modbus.procimg.Register[] registers)
      Description copied from class: ModbusRegisterElement
      Converts the Registers from j2mod to the expected type.

      The length of the registers array is guaranteed to match `this.length`.

      Specified by:
      registersToValue in class ModbusRegisterElement<SELF extends AbstractModbusElement<SELF,com.ghgande.j2mod.modbus.procimg.Register[],T>,T>
      Parameters:
      registers - the Registers
      Returns:
      the typed/converted value
    • valueToRaw

      protected com.ghgande.j2mod.modbus.procimg.Register[] valueToRaw(T value)
      Specified by:
      valueToRaw in class AbstractModbusElement<SELF extends AbstractModbusElement<SELF,com.ghgande.j2mod.modbus.procimg.Register[],T>,com.ghgande.j2mod.modbus.procimg.Register[],T>
    • wordOrder

      public final SELF 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
    • getWordOrder

      protected WordOrder getWordOrder()