Declaring and editing the global variables within the global-variables-editor

How to declare a →global variable within a global-object:

  1. Go to tab Variables in the global-variables-editor.

  2. From the context menu, select New Variable . Alternative: Press the Ctrl-key and the +-key
    Result: A new global variable is inserted. The type of the selected variable is used, if a variable has been selected. Without any selection, a new global variable of data type BOOL is inserted.

  3. Correct the data of this global variable as requested by selecting this variable and clicking onto the respective column of the variable.
    Alternative: Use the respective command provided within the context menu under Edit or press the respective shortcut (if there is any).

    Column

    Command under "Edit"
    (Shortcut)

    Additional information

    Name

    Name
    (F2-key)

    The name must be an →IEC-identifier.

    Section

    Section

    A section is created in the tab Sections. The definitions of this section are applied to the global variable.
    The best practice is to use the content assist to select a section from the list of all existing sections.

    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg Point to this column to get a tooltip on the section (e.g. whether the section is defined with CONSTANT).

    Type

    Type

    See "Supported types (for global variables)".

    Initial value

    Initial value

    optional: See: "→Initial value"

    HW address

    HW address

    optional; physical address in the →PLC
    See "Physical address for global variable".

    Description

    Description

    optional; A text with several lines is possible – press Shift+Enter .
    If you need the code for a newline in a textual editor, please refer to "Which code is required for a newline in a description or comment?".

    Comment

    Comment

    Custom data

    Custom data

    optional; The input is possible as →JSON-string or as a string primitive within "" (example: "This is my data").

  4. Enter the requested text.

  5. Accept the change by pressing the Enter-key or clicking the primary mouse button outside of the current field . Press the ESC-key , if you want to discard the change.

    Restriction for renaming a global or external variable

    The corresponding counterpart is not automatically renamed.
    This means: When renaming a global variable, the external variable of the same name is not renamed. Likewise when renaming an external variable, the global variable of the same name is not renamed.

Physical address for global variable

Examples for physical addresses:

Example

Explanation

%QB7

output, byte, 7th element (in the 1st level)

%IX1

input, bool, 1st element (in the 1st level)

%I1

input, bool, 1st element (in the 1st level)

%IW2.5.7.3

input, word, 3rd element in the 7th "module" in the 5th "rack" of the 2nd "bus"

If you are using EtherCAT fieldbuses that can be addressed via →EC-Master and →EC-Engineer, see "Accessing hardware IOs via EC-Master and EC-Engineer of Acontis" for information on access of their hardware IOs.

Necessary structure for physical address

Enter a physical address according to this structure:


Character

Meaning

1.

%

initiates the address

2.

prefix for location

defines the location


I

input


Q

output


M

memory

3.

prefix for size

defines the size


X or none

bool (single bit)


B

byte (8 bits)


W

word (16 bits)


D

double word (32 bits)


L

long word (64 bits)

4.

one or more →unsigned integers
You must separate the integers by . in order to enter hierarchical levels.
Enter the highest level as leftmost number, the lower levels as numbers to the right.

Restriction

Depending on the PLC platform and the IO provider, logi.CAD 3 supports max. 5 levels. C ontact your system integrator for details.
The highest possible number per level is: 4_294_967_295 (that corresponds to UINT32_MAX) – The underscore characters _ are inserted as separators to make the value more readable, hence _ is not significant.

defines the address