Creating and using a global-object

How to create a global-object:

  1. Select a folder in the project in which you want to create the global-object.

  2. In menu File or from the context menu of the folder, select New and the command Global-Object.

  3. In the dialog, enter a name under File Name.
    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg If possible, do not enter invalid characters (e.g. umlauts, blanks, the character –, numbers at the start) because the file name is automatically used as global-object-name and this name must be a valid →IEC-identifier. But if you need such invalid characters in the file name, delete or replace the invalid characters in Global-Object-Name before you click Finish.
    It is possible to change the global-object-name at any time later.

  4. Afterwards click Finish.
    Result::

    1. The global-object (with icon images/download/thumbnails/409862651/IconGlobal-version-1-modificationdate-1531214458366-api-v22.png ) is displayed in the views with projects and resources.

    2. The global-object is opened in the →graphical editor.

  5. Create or edit the content, e.g. the →global variables. Details: See"Actions within the global-variables-editor".

  6. In order to use the global variables within the application, insert the INCLUDE_GLOBALS directive within the ST-object (in the ST-program) or in the PLC-object (in the resource or configuration). See "Declaration of global variables in global-object and its usage in ST" for the required directive.