Variables configuration - var_config, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 983

Advertising
background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

981

16.1.21

Variables configuration - VAR_CONFIG
The "Variables configuration" can be used to map function block variables on the
process image, that is on the device I/Os, without the need of specifying the definite
address already in the declaration of the function block variable. The assignment of
the definite address in this case is done centrally for all function block instances in a
global VAR_CONFIG list.
For this purpose you can assign "incomplete" addresses to the function block variables
declared between the key words VAR and END_VAR. These addresses are to be
identified with an asterisk.
Syntax:
<identifier> AT %<I|Q>* : <data type>;

Example of the use of not completely defined addresses:

FUNCTION_BLOCK locio
VAR
xLocIn AT %I*: BOOL := TRUE;
xLocOut AT %Q*: BOOL;
END_VAR

Here two local I/O-variables are defined, a local-In (%I*) and a local-Out (%Q*).

Then the final definition of the addresses is to be done in the "Variables Configuration"
in a global variables list:
For this purpose add a 'Global Variable list' object (GVL) to the Devices window by the
Add Object command. There enter the declarations of the instance variables with the
definite addresses between the key words VAR_CONFIG and END_VAR.
The instance variables must be specified by the complete instance path through which
the individual POUs and instance names are separated from one another by periods.
The declaration must contain an address whose class (input/output) corresponds to
that of the incompletely specified address (%I*, %Q*) in the function block. Also the
data type must agree with the declaration in the function block.
Syntax:
<instance variable path> AT %<I|Q><location> : <data type>;
Configuration variables, whose instance path is invalid because the instance does not
exist, are denoted as errors. On the other hand, an error is also reported if no definite
address configuration exists for an instance variable assigned to an incomplete
address.

Advertising