4.6.2 Variables
Variables contain the values of inputs, outputs, or the internal devices of the PLC.A distinction
is made between two different types of variables:
쎲
Global variables and
쎲
Local variables
Global Variables can be regarded as “shared” variables and are the interface to physical PLC
devices. They are made available to all POU’s and reference an actual physical PLC I/O or
named internal devices within the PLC. Global Variables make it possible to exchange data
between the individual POUs.
For a particular POU to access a Global Variable, it must be declared in the Header of this
POU. The Header can be made up of both Global Variables and Local Variables.
A Local Variable can be thought of as an intermediate result. A POUs can not access Local
Variables of other POUs.
Declaring Variables
At the start of each POE the variables are declared, i.e.they are assigned to a certain data type
like INT or BOOL.
Each variable has the following elements:
쎲
Class
쎲
Identifier, the name of the variable
쎲
Absolute address (optional for global variables)
쎲
Data type
쎲
Inital value (is specified automatically)
쎲
Comment (optional)
MELSEC System Q Beginners Manual 4 – 11
An Introduction to Programming The IEC 61131-3 Standard
Global
Variables
Local
variables
of
POU 1
Local
variables
of
POU 2
PLC program
of POE 1
PLC program
of POE 2
Header
Body
Header
Body