Class StringWordElement
java.lang.Object
io.openems.edge.bridge.modbus.api.element.AbstractModbusElement<T>
io.openems.edge.bridge.modbus.api.element.AbstractModbusRegisterElement<StringWordElement,String>
io.openems.edge.bridge.modbus.api.element.StringWordElement
- All Implemented Interfaces:
ModbusElement<String>
,ModbusRegisterElement<String>
An StringWordElement represents a String value. Each Register (= 2 bytes)
represents two characters.
-
Field Summary
FieldsFields inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusElement
abstractTask, onSetNextWriteCallbacks
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
_setInputRegisters
(com.ghgande.j2mod.modbus.procimg.InputRegister... registers) void
_setNextWriteValue
(Optional<String> valueOpt) Sets a value that should be written to the Modbus device.protected String
fromByteBuffer
(ByteBuffer buff) final int
Number of Registers or Coils.protected StringWordElement
self()
Gets an instance of the correct subclass of myself.protected ByteBuffer
toByteBuffer
(ByteBuffer buff, String value) Methods inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusRegisterElement
byteOrder, getByteOrder, getNextWriteValue, setInputRegisters, setNextWriteValueRegisters
Methods inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusElement
deactivate, debug, getModbusTask, getStartAddress, getType, invalidate, isDebug, isIgnored, onSetNextWrite, onUpdateCallback, setModbusTask, setValue, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.openems.edge.bridge.modbus.api.element.ModbusElement
deactivate, getStartAddress, getType, invalidate, isIgnored, onSetNextWrite, setModbusTask
Methods inherited from interface io.openems.edge.bridge.modbus.api.element.ModbusRegisterElement
getNextWriteValueAndReset, setNextWriteValue
-
Field Details
-
byteOrder
-
-
Constructor Details
-
StringWordElement
public StringWordElement(int startAddress, int length)
-
-
Method Details
-
getLength
public final int getLength()Description copied from interface:ModbusElement
Number of Registers or Coils.- Returns:
- the number of Registers or Coils
-
_setInputRegisters
protected final void _setInputRegisters(com.ghgande.j2mod.modbus.procimg.InputRegister... registers) - Specified by:
_setInputRegisters
in classAbstractModbusRegisterElement<StringWordElement,
String>
-
_setNextWriteValue
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
-
fromByteBuffer
-
toByteBuffer
-
self
Description copied from class:AbstractModbusRegisterElement
Gets an instance of the correct subclass of myself.- Specified by:
self
in classAbstractModbusRegisterElement<StringWordElement,
String> - Returns:
- myself
-