Class ModbusElement
java.lang.Object
io.openems.edge.bridge.modbus.api.element.ModbusElement
- Direct Known Subclasses:
AbstractModbusElement
This abstract class serves as an Interface-like abstraction to avoid Java
Generics for external access.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
Number of Registers or Coils.final int
The start address of this Modbus element. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
This is called on deactivate of the Modbus-Bridge.final Task
abstract void
invalidate
(AbstractModbusBridge bridge) Invalidates the Channel in case it could not be read from the Modbus device, i.e.final void
setModbusTask
(Task task) Set theTask
, where this Element belongs to.
-
Field Details
-
startAddress
public final int startAddressThe start address of this Modbus element. -
length
public final int lengthNumber of Registers or Coils.
-
-
Constructor Details
-
ModbusElement
public ModbusElement(int startAddress, int length)
-
-
Method Details
-
deactivate
public abstract void deactivate()This is called on deactivate of the Modbus-Bridge. It can be used to clear any references like listeners. -
invalidate
Invalidates the Channel in case it could not be read from the Modbus device, i.e. sets the value to 'UNDEFINED'/null. Applies the 'invalidateElementsAfterReadErrors' config setting of the bridge.- Parameters:
bridge
- theAbstractModbusBridge
-
setModbusTask
Set theTask
, where this Element belongs to.This is called by the
AbstractTask
constructor.- Parameters:
task
- theTask
-
getModbusTask
-