Class S7Tag
- java.lang.Object
-
- org.apache.plc4x.java.s7.readwrite.tag.S7Tag
-
- All Implemented Interfaces:
PlcTag,Serializable
- Direct Known Subclasses:
S7StringFixedLengthTag,S7StringVarLengthTag
public class S7Tag extends Object implements PlcTag, Serializable
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringBIT_OFFSETprotected static StringBLOCK_NUMBERprotected static StringBYTE_OFFSETprotected static StringDATA_TYPEprotected static StringMEMORY_AREAprotected static StringNUM_ELEMENTSprotected static StringSTRING_LENGTHprotected static StringTRANSFER_SIZE_CODE
-
Constructor Summary
Constructors Modifier Constructor Description protectedS7Tag(TransportSize dataType, MemoryArea memoryArea, int blockNumber, int byteOffset, byte bitOffset, int numElements)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static intcheckByteOffset(int byteOffset)checks if ByteOffset from S7Tag is in valid rangeprotected static intcheckDataBlockNumber(int blockNumber)checks if DataBlockNumber of S7Tag is in valid rangeStringgetAddressString()List<ArrayInfo>getArrayInfo()bytegetBitOffset()intgetBlockNumber()intgetByteOffset()TransportSizegetDataType()MemoryAreagetMemoryArea()protected static MemoryAreagetMemoryAreaForShortName(String shortName)intgetNumberOfElements()StringgetPlcDataType()PlcValueTypegetPlcValueType()protected static ShortgetSizeCode(String value)static booleanmatches(String tagString)static S7Tagof(String tagString)voidserialize(WriteBuffer writeBuffer)StringtoString()
-
-
-
Field Detail
-
DATA_TYPE
protected static final String DATA_TYPE
- See Also:
- Constant Field Values
-
STRING_LENGTH
protected static final String STRING_LENGTH
- See Also:
- Constant Field Values
-
TRANSFER_SIZE_CODE
protected static final String TRANSFER_SIZE_CODE
- See Also:
- Constant Field Values
-
BLOCK_NUMBER
protected static final String BLOCK_NUMBER
- See Also:
- Constant Field Values
-
BYTE_OFFSET
protected static final String BYTE_OFFSET
- See Also:
- Constant Field Values
-
BIT_OFFSET
protected static final String BIT_OFFSET
- See Also:
- Constant Field Values
-
NUM_ELEMENTS
protected static final String NUM_ELEMENTS
- See Also:
- Constant Field Values
-
MEMORY_AREA
protected static final String MEMORY_AREA
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
S7Tag
protected S7Tag(TransportSize dataType, MemoryArea memoryArea, int blockNumber, int byteOffset, byte bitOffset, int numElements)
-
-
Method Detail
-
getAddressString
public String getAddressString()
- Specified by:
getAddressStringin interfacePlcTag
-
getPlcValueType
public PlcValueType getPlcValueType()
- Specified by:
getPlcValueTypein interfacePlcTag
-
getArrayInfo
public List<ArrayInfo> getArrayInfo()
- Specified by:
getArrayInfoin interfacePlcTag
-
getDataType
public TransportSize getDataType()
-
getPlcDataType
public String getPlcDataType()
-
getMemoryArea
public MemoryArea getMemoryArea()
-
getBlockNumber
public int getBlockNumber()
-
getByteOffset
public int getByteOffset()
-
getBitOffset
public byte getBitOffset()
-
getNumberOfElements
public int getNumberOfElements()
-
matches
public static boolean matches(String tagString)
-
checkDataBlockNumber
protected static int checkDataBlockNumber(int blockNumber)
checks if DataBlockNumber of S7Tag is in valid range- Parameters:
blockNumber- given DataBlockNumber- Returns:
- given blockNumber if Ok, throws PlcInvalidTagException otherwise
-
checkByteOffset
protected static int checkByteOffset(int byteOffset)
checks if ByteOffset from S7Tag is in valid range- Parameters:
byteOffset- given byteOffset- Returns:
- given byteOffset if Ok, throws PlcInvalidTagException otherwise
-
getMemoryAreaForShortName
protected static MemoryArea getMemoryAreaForShortName(String shortName)
-
serialize
public void serialize(WriteBuffer writeBuffer) throws SerializationException
- Specified by:
serializein interfaceSerializable- Throws:
SerializationException
-
-