Declaring external variables by using a list of the content assist in FBD

If you declare an →external variable (VAR_EXTERNAL) as described under "Declaring variables in FBD", it is imperative that you know the name of the basic →global variable. If you enter any name and there is no such global variable, the entry is highlight as faulty.

Use the next list of the content assist in order to declare an external variable based on a global variable and have it entered in a →value field:

  1. Position the mouse pointer over an empty space – where you need the value field with the external variable.

  2. Start the content assist: From the context menu of the FBD-editor, select Content Assist. Alternative: Press Ctrl+Space.
    Result: A list is displayed with all →variables already declared in the POU and with all available →functions and →function blocks.

  3. Now press Ctrl+Space again.
    Result: The list changes to display the global variables (icon images/download/thumbnails/413893074/VarGlobal-version-1-modificationdate-1533808466516-api-v2.png ) that have been declared in →programs or →resources (within a PLC-object). The entry for the global variable includes its data type. Example: portSetting : INT – Meaning: This is the global variable with name portSetting and →data type INT.

  4. Enter one or more letters. This displays a list with all elements fitting your input.
    Example: Enter port. The list provides all global variables containing the text port.

  5. Click an element in the list or select it (by using the mouse or the cursor movement keys) and press the Enter-key .
    If you want to close the list without any action, click the primary mouse button outside the input field or press the ESC-key.

  6. Position the value field in the FBD-editor by pressing the primary mouse button or the Enter-key. If the external variable does not exist yet, it is automatically declared and listed in the list of the declared variables.