
L-INX/L-GATE User Manual
75
LOYTEC
LOYTEC electronics GmbH
8.4.1 Managing Variables
On a function plan, three basic types of variables may be created using the tabs shown below
the function plan sheet:
VAR:
Variables created on this tab will be visible only to the logic designed on this
group of sheets. It will not be accessible to any other programs or to any function blocks
which are used in this program. It is similar to a ‘static’ variable declaration in a C code
function.
VAR GLOBAL:
Variables declared here will be accessible to the entire program,
including any function blocks which are called by the program. Function blocks which
need to reference this variable need to have a suitable declaration of an external variable
(see next point). This declaration is similar to a ‘static’ declaration of a C variable outside
a function, which will be visible to all functions inside the C code module, but not visible
to other modules.
VAR EXTERNAL:
Variables declared in this list will be treated as open references to
a global variable which exists somewhere in the scope of the device on which the
program will be executed. This means that a global variable needs to be declared on the
device resource, which will be available to all programs running on the device. If the
physical address parameter of the variable is set to %I, %O, or %M, the variable will be
handed down to the I/O driver of the L-INX for processing. If a suitable IEC61131
variable exists in the data point configuration of the device, its value will be forwarded
by the I/O driver between the PLC variable and the data point. If no physical address is
set, the variable will only be visible to the PLC programs but not to the I/O driver, which
may be used to exchange data between PLC tasks.
The basic data flow between the CEA709 network (or BACnet and other technologies) and
the PLC program is depicted in Figure 56.
IEC61131
variables
IEC61131 program
IEC61131
variables
Input NVs
DP
DP
Output NVs
Figure 56: Connecting IEC61131 variables
The place where global variables are created on the device is shown in Figure 57.
Figure 57: Global Variables Object
When starting a new project, no global variables object is available; it must be created before
compiling the IEC61131 application. The global variables object is created automatically by
the LINX Configurator when exporting variables to logiCAD.