Class CoilElement
java.lang.Object
io.openems.edge.bridge.modbus.api.element.AbstractModbusElement<Boolean>
io.openems.edge.bridge.modbus.api.element.CoilElement
- All Implemented Interfaces:
ModbusCoilElement
,ModbusElement<Boolean>
A CoilElement has a size of one Modbus Coil or 1 bit.
-
Field Summary
Fields inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusElement
abstractTask
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
_setNextWriteValue
(Optional<Boolean> valueOpt) Sets a value that should be written to the Modbus device.int
Number of Registers or Coils.Gets the next write value.void
setInputCoil
(Boolean coil) Sets the boolean value of this Element from Modbus Coil.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.ModbusCoilElement
getNextWriteValueAndReset, setNextWriteValue
Methods inherited from interface io.openems.edge.bridge.modbus.api.element.ModbusElement
deactivate, getStartAddress, getType, invalidate, isIgnored, onSetNextWrite, setModbusTask
-
Constructor Details
-
CoilElement
public CoilElement(int startAddress)
-
-
Method Details
-
getNextWriteValue
Description copied from interface:ModbusCoilElement
Gets the next write value.- Specified by:
getNextWriteValue
in interfaceModbusCoilElement
- Returns:
- the Optional next write value
-
getLength
public int getLength()Description copied from interface:ModbusElement
Number of Registers or Coils.- Specified by:
getLength
in interfaceModbusElement<Boolean>
- Returns:
- the number of Registers or Coils
-
_setNextWriteValue
Description copied from interface:ModbusElement
Sets a value that should be written to the Modbus device.- Specified by:
_setNextWriteValue
in interfaceModbusElement<Boolean>
- Parameters:
valueOpt
- the Optional value- Throws:
OpenemsException
- on error
-
setInputCoil
Description copied from interface:ModbusCoilElement
Sets the boolean value of this Element from Modbus Coil.- Specified by:
setInputCoil
in interfaceModbusCoilElement
- Parameters:
coil
- the value- Throws:
OpenemsException
- on error
-