A global variables list (GVL) is used to declare global variables. If a GVL is placed in the , the variables will be available for the entire project. If a GVL is assigned to a certain application, the variables will be valid within this application.
To add a GVL to an existing application, select the application node in the
, click the green plus button and select . Alternatively you can right-click the node and execute the command . If you select the node in these views, the new GVL object will application-independent.Use the GVL editor to edit a global variable list.
The variables contained in a GVL can be defined to be available as network variables for a broadcast data exchange with other devices in the network. For this purpose, configure network properties (in the menu or ) for the GVL.
The value of a global constant provided via a library can be replaced by a value defined by the application. For this purpose, the constant has to be declared in a parameter list in the library. Then, when the library is included in the application, its value can be edited in the
tab of the of the application. See the following example for a description on how to do in detail.
A library lib1.library
provides an array variable g_Array
. The size of the array variable is defined by a global constant g_c_Arraysize
. The library is included in various applications, each needing a different array size. Therefore, you want to overwrite the global constant of the library by an application-specific value.
Proceed as follows: When creating lib1.library
, define the global constant g_c_Arraysize
within a special type of global variable list (GVL), the so-called parameter list. For this purpose, execute the command and add a parameter list object, in the current example named Param
. In the editor of this object, which equals that of a standard GVL, insert the declaration of variable g_c_Arraysize
.
Parameter list Param
in library Lib1.library
Edit parameter g_c_Arraysize
in the of a project
Select the library in the upper part of the Param
in order to open the tab showing the declarations. Select the cell in column and use the empty space to open an edit field. Enter the desired new value for g_c_Arraysize
. It will be applied to the current, local scope of the library after having closed the edit field.