The operator is an extension of the IEC 61131-3 standard.
The operator yields information about a variable. You can save the information as
data structure in a variable of data type __SYSTEM.VAR_INFO
.
Syntax in the declaration
<name of the info variable> : __SYSTEM.VAR_INFO; // Data structure for info variable
Syntax for calls
<name of the info variable> := __VARINFO( <variable name> ); // Call of the operator
Example
FUNCTION_BLOCK FB_Velocity VAR_INPUT rVelocity: REAL := 1.2; END_VAR VAR_OUTPUT END_VAR VAR infoVelocity: __SYSTEM.VAR_INFO; //Info of Velocity END_VAR infoVelocity := __VARINFO(rVelocity); // Gets the info of Velocity locally
PROGRAM PLC_PRG VAR iCounter : INT := 0; // Counts the calls infoCounter : __SYSTEM.VAR_INFO; //Info of Counter arrA : ARRAY [1..2, 1..2, 1..2] OF INT := [0, 1, 2, 3, 4, 5, 6, 7]; // Stores the A data infoA : __SYSTEM.VAR_INFO; //Info of A fbVel : FB_Velocity; END_VAR iCounter := iCounter + 1; infoCounter := __VARINFO(iCounter); infoA := __VARINFO(arrA); fbVel();
The iCounter
and arrA
variables are recognized in the application code. The variable information is saved
in the infoCounter
and infoA
variables. Moreover, the FB_Velocity
function block is instantiated.
-
Data Type: __SYSTEM.VAR_INFO