
L-INX/L-GATE User Manual
93
LOYTEC
LOYTEC electronics GmbH
Figure 78: Declaring a retain variable.
The retain attribute should be used in global variables and local variables on function plan
only. Global variables on the device resource are managed by the I/O driver and must not use
the retain attribute. Instead data point persistency (see Section 8.6.4) must be used for those
variables. Furthermore, it is not recommended to mark local variables in function blocks as
retain variables.
The contents of retain variables are written to Flash storage every 5 minutes and when
shutting down the device. This provides good compromise between write granularity for
normal operation and ensuring Flash life-time. If the contents shall be written explicitly at a
defined time, use the
RetainCtl
function block located in the
logi.library/Data
folder.
Connect the store input (S) and set this input TRUE for one cycle to trigger writing retain
data. Make sure to set the input back to FALSE after this cycle to avoid multiple consecutive
writes.
8.6.6 L-INX System Registers, System Time
L-INX system registers, such as the system time or the CPU load, can be used within
IEC61131 programs. Therefore, for each system input variable, a global input variable of
type UDINT may be created within the IEC61131 program. Then, connections to the
appropriate system registers are created manually with the L-INX Configurator.
To use the system time within the IEC61131 program, connect the AtoDT converter (located
in the StandardLibs->IEC61131-3_ (EXT) folder) to the global input variable that receives
the system time.
8.6.7 Code Protection
There are 4 data points used for code protection. These data points, in combination with an
adapted IEC61131 program, can be used to protect your 61131-Program Intellectual
Property. Please contact LOYTEC sales for further information.
8.6.8 Using Structured Data Point Members
Some network technologies provide structured data points. Their types are defined by the
network technology and are available in the Configurator. Those structure types can either