Class ModbusRegisterElement<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>
- Type Parameters:
SELF
- the subclass of myselfBINARY
- the binary typeT
- the OpenEMS type
- Direct Known Subclasses:
AbstractMultipleWordsElement
,AbstractSingleWordElement
public abstract class ModbusRegisterElement<SELF extends AbstractModbusElement<SELF,com.ghgande.j2mod.modbus.procimg.Register[],T>,T>
extends AbstractModbusElement<SELF,com.ghgande.j2mod.modbus.procimg.Register[],T>
A ModbusRegisterElement represents one or more Modbus Registers.
-
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
ConstructorsModifierConstructorDescriptionprotected
ModbusRegisterElement
(OpenemsType type, int startAddress, int length) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract T
byteBufferToValue
(ByteBuffer buff) final SELF
Sets the Byte-Order.protected final T
commonRegistersToValue
(com.ghgande.j2mod.modbus.procimg.Register[] registers, WordOrder wordOrder) protected final ByteOrder
protected final T
rawToValue
(com.ghgande.j2mod.modbus.procimg.Register[] registers) Converts the RAW value from j2mod to the expected type.protected abstract T
registersToValue
(com.ghgande.j2mod.modbus.procimg.Register[] registers) Converts theRegister
s from j2mod to the expected type.protected abstract void
valueToByteBuffer
(ByteBuffer buff, T value) protected final com.ghgande.j2mod.modbus.procimg.Register[]
valueToRaw
(T value, WordOrder wordOrder) 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, valueToRaw
Methods inherited from class io.openems.edge.bridge.modbus.api.element.ModbusElement
getModbusTask, setModbusTask
-
Constructor Details
-
ModbusRegisterElement
-
-
Method Details
-
byteBufferToValue
-
valueToByteBuffer
-
byteOrder
Sets the Byte-Order. Default is "BIG_ENDIAN". See http://www.simplymodbus.ca/FAQ.htm#Order.- Parameters:
byteOrder
- the ByteOrder- Returns:
- myself
-
getByteOrder
-
valueToRaw
-
rawToValue
Description copied from class:AbstractModbusElement
Converts the RAW value from j2mod to the expected type.- Specified by:
rawToValue
in classAbstractModbusElement<SELF extends AbstractModbusElement<SELF,
com.ghgande.j2mod.modbus.procimg.Register[], T>, com.ghgande.j2mod.modbus.procimg.Register[], T> - Parameters:
registers
- the raw value- Returns:
- the typed/converted value
-
registersToValue
Converts theRegister
s from j2mod to the expected type.The length of the registers array is guaranteed to match `this.length`.
- Parameters:
registers
- the Registers- Returns:
- the typed/converted value
-
commonRegistersToValue
-