Class ModbusRecordCycleValue<T extends OpenemsComponent>
java.lang.Object
io.openems.edge.common.modbusslave.ModbusRecord
io.openems.edge.common.modbusslave.ModbusRecordCycleValue<T>
- Type Parameters:
T
- theOpenemsComponent
ModbusRecordCycleValue
s allow to receive a ModbusRecord
via a
Function
. The Function is executed in the 'run()' method of the
Modbus-TCP-Api-Controller.-
Constructor Summary
ConstructorDescriptionModbusRecordCycleValue
(int offset, String name, Unit unit, String valueDescription, ModbusType type, Function<T, Object> function) -
Method Summary
Modifier and TypeMethodDescriptionGets theAccessMode
.getName()
Gets the name.getUnit()
byte[]
getValue
(OpenemsComponent component) Gets the value.Gets the value description.toString()
void
updateValue
(T component) Update the Value of this ModbusRecord.void
writeValue
(int index, byte byte1, byte byte2) Sets the write value.Methods inherited from class io.openems.edge.common.modbusslave.ModbusRecord
getComponentId, getOffset, getType, setComponentId
-
Constructor Details
-
ModbusRecordCycleValue
-
-
Method Details
-
toString
-
updateValue
Update the Value of this ModbusRecord.This method is called on every cycle by the run()-method of the Modbus-TCP-Api-Controller. Value is set to 'null' if provided 'component' is null.
- Parameters:
component
- theOpenemsComponent
-
getValue
Description copied from class:ModbusRecord
Gets the value.- Specified by:
getValue
in classModbusRecord
- Parameters:
component
- the actualOpenemsComponent
- Returns:
- the value as byte array
-
writeValue
public void writeValue(int index, byte byte1, byte byte2) Description copied from class:ModbusRecord
Sets the write value.- Specified by:
writeValue
in classModbusRecord
- Parameters:
index
- the buffer indexbyte1
- the first bytebyte2
- the second byte
-
getName
Description copied from class:ModbusRecord
Gets the name.- Specified by:
getName
in classModbusRecord
- Returns:
- the name
-
getUnit
- Overrides:
getUnit
in classModbusRecord
-
getValueDescription
Description copied from class:ModbusRecord
Gets the value description.- Specified by:
getValueDescription
in classModbusRecord
- Returns:
- the value description
-
getAccessMode
Description copied from class:ModbusRecord
Gets theAccessMode
.- Specified by:
getAccessMode
in classModbusRecord
- Returns:
- the
AccessMode
-