Global Variable List
A global variable list (GVL) is used to declare global variables. These are available project-wide.
A GVL can have the following relationship types:
- Composition: a class can contain other program elements.
- Association: a class can know other program elements.
A global variable list is represented by a two-part rectangle in pale pink and headed with <<global>>. All attributes are shown after the first dividing line:
<attribute name>: <data type>
Properties
“Property” |
Description |
---|---|
“Identifier” |
Insert or change an unique name of the selected element. |
Edit GVL
The following user inputs are available if “Selection” is enabled in the toolbox (default).
User input in the class diagram | Response in the class diagram | Description |
---|---|---|
Select the tool "Global Variable List (GVL)": Click in an empty area of the diagram. The dialog "Add Global Variables List" opens. Enter a name for the new object and close the dialog with "Add". | A GVL is created. | The object exists in the diagram and in the project. The view in the project tree is updated automatically. |
Click on a GVL object. | Command icons are visible to the left above the object. | |
Click on . | GVL is only removed from the diagram. | Use "flat" removal to remove it from the class diagram view only. The object still exists and is visible in the project tree. |
Click on . | GVL is removed from the diagram and the project. | The object is removed. It then no longer exists. |
Click on , then on an existing class or a DUT. | A composition points from the GVL to the selected class or DUT. | The declaration of GVL contains the instantiation based on the selected element. Example: fbExistent : FB_Existent; |
Click on and then in an empty area of the diagram. | A composition points from the GVL to the new class. | The GVL contains the declaration. Example: fbNew: FB_New; |
Click on , then on an existing class or a DUT. | An association points from the GVL to the selected class or DUT. | The GVL contains the declaration for the selected element. Example: pExistent: POINTER TO FB_Existent; |
Click on and then in an empty area of the diagram. | An association points from the GVL to the new class. | The GVL contains the declaration for the new class. Example: pNew: POINTER TO FB_New; |
Click on . |
| The attribute or operation list is minimized. |
Click on . |
| The attribute or operation list expands. |
Click on an identifier. Once it is selected, click again. | After the first click, the name has a blue border. After the second click the line editor opens. | Change the class name in the line editor. The change is applied synchronously to the project. That is, the object name in the project tree and in the declaration section of the POU is adjusted immediately. |
Double-click an element. | The corresponding object editor opens, and the declaration and implementation are displayed. | Edit the declaration or implementation. After closing of the object you are returned to class diagram. The changes are automatically applied to the class diagram. |
Keep in mind that the default settings in the dialog 'Add POU' originate from the last application of this dialog. |
Sample
- Composition
VAR_GLOBAL
fbMessage : FB_Message;
END_VAR