This section describes how system variables are implemented. System variables:
allow you to access general system information, perform system diagnostics, and command simple actions.
are structured variables conforming to IEC 61131-3 definitions and naming conventions. You can access the system variables using the IEC symbolic name PLC_GVL. Some of the PLC_GVL variables are read-only (for example, PLC_R) and some are read/write (for example, PLC_W).
are automatically declared as global variables. They have system-wide scope and can be accessed by any Program Organization Unit (POU) in any task.
The system variables are identified by:
a structure name that represents the category of system variable. For example, PLC_R represents a structure name of read-only variables used for the controller diagnostic.
a set of component names that identifies the purpose of the variable. For example, i_wVendorID represents the controller vendor ID.
You can access the system 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_GVL.PLC_R.i_dwSerialNumber;
myCtr_ID := PLC_GVL.PLC.R.i_wVendorID;
myCtr_FramesRx := SERIAL_R[0].i_udiFramesReceivedOK
Two system variables are defined for use when programming the controller:
located variables
unlocated variables
They are used in EcoStruxure Machine Expert programs according to the structure_name.component_name convention explained previously. %MW addresses from 0 to 59999 can be accessed directly. Addresses greater than this are considered out of range by EcoStruxure Machine Expert and can only be accessed through the structure_name.component_name convention.
The located variables:
have a fixed location in a static %MW area: %MW60000 to %MW60199 for read-only system variables.
are accessible through Modbus TCP, Modbus serial, and EtherNet/IP requests both in RUNNING and STOPPED states.
The unlocated variables:
are not physically located in the %MW area.
are not accessible through any fieldbus or network requests unless you locate them in the relocation table, and only then these variables can be accessed in RUNNING and STOPPED states. The relocation table uses the following dynamic %MW areas:
%MW60200 to %MW61999 for read-only variables
%MW62200 to %MW63999 for read/write variables