This operator is not specified by the IEC 61131-3 standard.
The __VARINFO operator provides 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.
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);
A variable with data type __SYSTEM.VAR_INFO contains the following elements:
Element |
Description |
---|---|
ByteAddress |
Address of the variable. |
ByteOffset |
Offset (in bytes). |
Area |
Number of the memory area. |
BitNr |
Number of the bit in the byte. If it is not a bit type, the value is -1. |
BitSize |
Size of the variable (in bits). |
BitAddress |
Bit address of the variable. |
TypeClass |
Data type class of the variable. |
TypeName |
Data type of the variable. |
NumElements |
For arrays: Number of array elements. |
BaseTypeClass |
For arrays: Data type class of the base data type. |
ElemBitSize |
For arrays: Bit size of an array element. |
MemoryArea |
Information for the memory area: memory, input, output, retain, global, local. |
Symbol |
Variable name. |
Comment |
Comment. |