Class BitsWordElement
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>
io.openems.edge.bridge.modbus.api.element.AbstractSingleWordElement<BitsWordElement,Boolean[]>
io.openems.edge.bridge.modbus.api.element.BitsWordElement
A BitsWordElement is an
UnsignedWordElement
where every bit
represents a Boolean value.-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a mapping for a given bit.bit
(int bitIndex, ChannelId channelId, AbstractOpenemsModbusComponent.BitConverter converter) Adds a mapping for a given bit.bit
(int bitIndex, ChannelId channelId, AbstractOpenemsModbusComponent.BitConverter converter, ChannelMetaInfoBit channelMetaInfoBit) Adds a mapping for a given bit.bit
(int bitIndex, ChannelId channelId, ChannelMetaInfoBit channelMetaInfoBit) Adds a mapping for a given bit.protected Boolean[]
byteBufferToValue
(ByteBuffer buff) protected void
protected Boolean[]
registersToValue
(com.ghgande.j2mod.modbus.procimg.Register[] registers) Length of registers array is guaranteed to be 1 here.protected BitsWordElement
self()
Gets an instance of the correct subclass of myself.protected void
valueToByteBuffer
(ByteBuffer buff, Boolean[] value) protected com.ghgande.j2mod.modbus.procimg.Register[]
valueToRaw
(Boolean[] values) Methods inherited from class io.openems.edge.bridge.modbus.api.element.ModbusRegisterElement
byteOrder, commonRegistersToValue, getByteOrder, rawToValue, valueToRaw
Methods inherited from class io.openems.edge.bridge.modbus.api.element.AbstractModbusElement
deactivate, debug, getNextWriteValueAndReset, invalidate, isDebug, onSetNextWrite, onUpdateCallback, setInputValue, setNextWriteValue, setNextWriteValueFromObject, toString
Methods inherited from class io.openems.edge.bridge.modbus.api.element.ModbusElement
getModbusTask, setModbusTask
-
Constructor Details
-
BitsWordElement
-
-
Method Details
-
self
Description copied from class:AbstractModbusElement
Gets an instance of the correct subclass of myself.- Specified by:
self
in classAbstractModbusElement<BitsWordElement,
com.ghgande.j2mod.modbus.procimg.Register[], Boolean[]> - Returns:
- myself
-
bit
public BitsWordElement bit(int bitIndex, ChannelId channelId, AbstractOpenemsModbusComponent.BitConverter converter) Adds a mapping for a given bit.- Parameters:
bitIndex
- the index of the bit; a number between 0 and 15channelId
- the Channel-IDconverter
- the Bit-Converter- Returns:
- myself for builder pattern
-
bit
public BitsWordElement bit(int bitIndex, ChannelId channelId, ChannelMetaInfoBit channelMetaInfoBit) Adds a mapping for a given bit.- Parameters:
bitIndex
- the index of the bit; a number between 0 and 15channelId
- the Channel-IDchannelMetaInfoBit
- an object that holds meta information about the Channel- Returns:
- myself for builder pattern
-
bit
public BitsWordElement bit(int bitIndex, ChannelId channelId, AbstractOpenemsModbusComponent.BitConverter converter, ChannelMetaInfoBit channelMetaInfoBit) Adds a mapping for a given bit.- Parameters:
bitIndex
- the index of the bit; a number between 0 and 15channelId
- the Channel-IDconverter
- the Bit-ConverterchannelMetaInfoBit
- an object that holds meta information about the Channel- Returns:
- myself for builder pattern
-
bit
Adds a mapping for a given bit.- Parameters:
bitIndex
- the index of the bit; a number between 0 and 15channelId
- the Channel-ID- Returns:
- myself for builder pattern
-
valueToRaw
- Overrides:
valueToRaw
in classAbstractSingleWordElement<BitsWordElement,
Boolean[]>
-
registersToValue
Length of registers array is guaranteed to be 1 here.- Overrides:
registersToValue
in classAbstractSingleWordElement<BitsWordElement,
Boolean[]> - Parameters:
registers
- the Registers- Returns:
- the typed/converted value
-
onNextWriteValueReset
protected void onNextWriteValueReset()- Overrides:
onNextWriteValueReset
in classAbstractModbusElement<BitsWordElement,
com.ghgande.j2mod.modbus.procimg.Register[], Boolean[]>
-
byteBufferToValue
- Specified by:
byteBufferToValue
in classModbusRegisterElement<BitsWordElement,
Boolean[]>
-
valueToByteBuffer
- Specified by:
valueToByteBuffer
in classModbusRegisterElement<BitsWordElement,
Boolean[]>
-