Operator ‘__VARINFO’¶
This operator is an extension of the IEC 61131-3 standard.
The operator yields information about a variable of the project at runtime. The information is stored as a data structure in a variable of data type __SYSTEM.VAR_INFO
.
Example
At runtime, the variable MyVarInfo
contains the information about the variable MyVar
.
//Declaration
VAR
MyVarInfo : __SYSTEM.VAR_INFO;
MyVAR : INT;
END_VAR
//Program code
MyVarInfo := __VARINFO (MyVar);
Data type SYSTEM.VAR_INFO
ByteAddress
: Address of the variableByteOffset
: Offset (in bytes)Area
: Number of the memory areaBitNr
: Number of the bit in the byte. If it is not a bit type: -1BitSize
: Size of the variable (in bits)BitAddress
: Bit address of the variableTypeClass
: Data type class of the variableTypeName
: Data type of the variableNumElements
: For arrays: Number of array elementsBaseTypeClass
: For arrays: Data type class of the base data typeElemBitSize
: For arrays: Bit size of an array elementMemoryArea
: Information for the memory area: memory, input, output, retain, global, localSymbol
: Variable nameComment
: Comment