Understanding System Variables

Introduction

This section describes how System Variables are implemented for the controller. These variables have the following attributes:

oSystem Variables allow you to access general system information, perform system diagnostics, and command simple actions.

oSystem Variables are structured variables conforming to IEC 61131-3 definitions and naming conventions. You can access the System Variables using IEC symbolic name PLC_GVL.

oSome of the PLC_GVL variables are read-only (for example, PLC_R) and some are read-write (for example, PLC_W).

oSystem Variables are automatically declared as global variables. They have system-wide scope and must be handled with care because they can be accessed by any Program Organization Unit (POU) in any task.

System Variables Naming Convention

The System Variables are identified by:

oa structure name which represents the category of System Variable (for example, PLC_R represents a structure name of read only variables used for the controller diagnosis).

oa set of component names which identifies the purpose of the variable (for example, i_wVendorID represents the controller Vendor ID).

You can access the variables by typing the structure name of the variables followed by the name of the component.

Here is an example of System Variable implementation:

VAR
   myCtr_Serial : DWORD;
   myCtr_ID : DWORD;
   myCtr_FramesRx : UDINT;
END_VAR

myCtr_Serial := PLC_R.i_dwSerialNumber;
myCtr_ID := PLC_R.i_wVendorID;
myCtr_FramesRx := SERIAL_R[0].i_udiFramesReceivedOK;

NOTE: The fully qualified name of the system variable in the example above is PLC_GVL.PLC_R.i_wVendorID. The PLC_GVL is implicit when declaring a variable using the Input Assistant, but it may also be entered in full.

System Variables Location

One type of system variable that is defined for use when programming the controller is unlocated variables.

These unlocated variables can only be accessed via login or sharing the symbol in Symbol Configuration to HMI.