Definition of Variables – GLOBAL and LOCAL
쎲
Variables
Before a program can be constructed, it must be decided what variables are going to be re-
quired in each particular program module. Each POU has a list of Local Variables, which
are defined and declared for use only for use within a particular POU. Global Variables can
be used by all the POU’s in the program and are declared in a separate list.
쎲
Local Variables
When program elements are declared as Local Variables, GX IEC Developer, automati-
cally, uses some of its System Variables, as appropriate storage devices within a specific
POU. These variables are exclusive to each POU and are not available to any other routine
within a project.
쎲
Global 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. External HMI and SCADA devices may inter-
face with the user program using Global Variables.
IEC61131-3 Verses MELSEC Variables
GX IEC Developer supports program creation, using either symbolic declarations (tag names),
or absolute Mitsubishi addresses (X0, M0 etc), assigned to the program elements.
The use of symbolic declarations complies with IEC 61131.3.
If symbolic declarations are used, then the tag names must be cross referenced to real PLC
addresses.
Local Variable List
For a particular POU to access a Global Variable, it must be declared in its Local Variable List
(LVL), in the POU Header.
The LVL can be made up of both Global Variables and Local Variables.
A Local Variable can be thought of as an intermediate result, i.e. if the program performs a five
stage calculation, using three values and ending with one result, traditionally, the programmer
would construct software, which produced several intermediate results, held in data registers
before ending with the final register result.
It is likely that these intermediate results, serve no purpose other than for storage and only the
final result is used elsewhere.
With GX IEC Developer, the intermediate results can be declared, as Local Variables and in this
case, only the original three numbers and the result, declared as Global Variables.
The Global Variable List
The Global Variable List (GVL) provides the interface for all names, which relate to real PLC
addresses, i.e. I/O data registers etc.
The GVL is available and can be read by all POU’s created in the project.
Software Structure and Definition of Terms
Programming
3 - 6
MITSUBISHI ELECTRIC
Summary of Contents for FX2N-32CAN
Page 1: ...MITSUBISHI ELECTRIC FACTORY AUTOMATION Programmable Logic Controllers GX IEC Developer ...
Page 2: ......
Page 4: ......
Page 6: ......
Page 10: ...IV MITSUBISHI ELECTRIC ...
Page 18: ...Modular PLC Training Hardware Course Overview and Requirements 1 2 MITSUBISHI ELECTRIC ...
Page 176: ...Device Edit 8 4 MITSUBISHI ELECTRIC ...
Page 190: ...Assigning DUT Variables to Function Blocks Data Unit Types DUT 10 10 MITSUBISHI ELECTRIC ...
Page 198: ...Array Example Single Dimension Array Arrays 11 8 MITSUBISHI ELECTRIC ...
Page 219: ...Sequential Function Chart SFC SFC Elements Training Manual GX IEC Developer 14 3 ...
Page 230: ...Structured Text Program Example IEC Structured Text 16 4 MITSUBISHI ELECTRIC ...
Page 278: ...PLC Components Glossary Appendix A 18 MITSUBISHI ELECTRIC ...
Page 283: ......