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 myselfT
- 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusElement
AbstractModbusElement.FillElementsPriority
-
Field Summary
Fields inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusElement
nextWriteValue, type
Fields inherited from class io.openems.edge.bridge.modbus.api.element.ModbusElement
length, startAddress
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMultipleWordsElement
(OpenemsType type, int startAddress, int length) -
Method Summary
Modifier and TypeMethodDescriptionprotected WordOrder
protected final T
registersToValue
(com.ghgande.j2mod.modbus.procimg.Register[] registers) Converts theRegister
s from j2mod to the expected type.protected com.ghgande.j2mod.modbus.procimg.Register[]
valueToRaw
(T value) final SELF
Sets the Word-Order.Methods inherited from class io.openems.edge.bridge.modbus.api.element.ModbusRegisterElement
byteBufferToValue, byteOrder, commonRegistersToValue, getByteOrder, rawToValue, valueToByteBuffer, valueToRaw
Methods inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusElement
_getFillElementsPriority, deactivate, debug, fillElementsPriority, getNextWriteValueAndReset, invalidate, isDebug, onNextWriteValueReset, onSetNextWrite, onUpdateCallback, self, setInputValue, setNextWriteValue, setNextWriteValueFromObject, toString
Methods inherited from class io.openems.edge.bridge.modbus.api.element.ModbusElement
getModbusTask, setModbusTask
-
Constructor Details
-
AbstractMultipleWordsElement
-
-
Method Details
-
registersToValue
Description copied from class:ModbusRegisterElement
Converts theRegister
s from j2mod to the expected type.The length of the registers array is guaranteed to match `this.length`.
- Specified by:
registersToValue
in classModbusRegisterElement<SELF extends AbstractModbusElement<SELF,
com.ghgande.j2mod.modbus.procimg.Register[], T>, T> - Parameters:
registers
- the Registers- Returns:
- the typed/converted value
-
valueToRaw
- Specified by:
valueToRaw
in classAbstractModbusElement<SELF extends AbstractModbusElement<SELF,
com.ghgande.j2mod.modbus.procimg.Register[], T>, com.ghgande.j2mod.modbus.procimg.Register[], T>
-
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
-