Class ModbusTag
- java.lang.Object
-
- org.apache.plc4x.java.modbus.base.tag.ModbusTag
-
- All Implemented Interfaces:
PlcTag,Serializable
- Direct Known Subclasses:
ModbusTagCoil,ModbusTagDiscreteInput,ModbusTagExtendedRegister,ModbusTagHoldingRegister,ModbusTagInputRegister
public abstract class ModbusTag extends Object implements PlcTag, Serializable
-
-
Field Summary
Fields Modifier and Type Field Description static PatternADDRESS_PATTERNstatic PatternFIXED_DIGIT_MODBUS_PATTERNstatic intPROTOCOL_ADDRESS_OFFSET
-
Constructor Summary
Constructors Modifier Constructor Description protectedModbusTag(int address, Integer quantity, ModbusDataType dataType)Instantiate a new ModbusTag
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetAddress()Get the technical address that must be used 'on the wire'StringgetAddressString()protected abstract StringgetAddressStringPrefix()List<ArrayInfo>getArrayInfo()ModbusDataTypegetDataType()intgetLengthBytes()intgetLengthWords()abstract intgetLogicalAddress()Get the logical (configured) addressintgetNumberOfElements()PlcValueTypegetPlcValueType()inthashCode()static ModbusTagof(String addressString)voidserialize(WriteBuffer writeBuffer)StringtoString()
-
-
-
Field Detail
-
ADDRESS_PATTERN
public static final Pattern ADDRESS_PATTERN
-
FIXED_DIGIT_MODBUS_PATTERN
public static final Pattern FIXED_DIGIT_MODBUS_PATTERN
-
PROTOCOL_ADDRESS_OFFSET
public static final int PROTOCOL_ADDRESS_OFFSET
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModbusTag
protected ModbusTag(int address, Integer quantity, ModbusDataType dataType)Instantiate a new ModbusTag- Parameters:
address- The WIRE address that is to be used.quantity- The number of registersdataType- The type for the interpretation of the registers.
-
-
Method Detail
-
getAddressString
public String getAddressString()
- Specified by:
getAddressStringin interfacePlcTag
-
getAddressStringPrefix
protected abstract String getAddressStringPrefix()
-
getAddress
public int getAddress()
Get the technical address that must be used 'on the wire'- Returns:
- The address that is to be used on the wire (shifted by 1 because of the modbus spec).
-
getLogicalAddress
public abstract int getLogicalAddress()
Get the logical (configured) address- Returns:
- The address which was configured and is different from what is used on the wire.
-
getNumberOfElements
public int getNumberOfElements()
-
getLengthBytes
public int getLengthBytes()
-
getLengthWords
public int getLengthWords()
-
getDataType
public ModbusDataType getDataType()
-
getPlcValueType
public PlcValueType getPlcValueType()
- Specified by:
getPlcValueTypein interfacePlcTag
-
getArrayInfo
public List<ArrayInfo> getArrayInfo()
- Specified by:
getArrayInfoin interfacePlcTag
-
serialize
public void serialize(WriteBuffer writeBuffer) throws SerializationException
- Specified by:
serializein interfaceSerializable- Throws:
SerializationException
-
-