Skip to main content

Tab: Variables

The variables for the data coming from a remote source are declared in the global variable list <name of data source>. The global variable list acts as a data interface to the remote PLC. The object is located below the application and below the DataSources_Objects folder.

For more information, see: Data Link with Data Sources

Update variables

Establishes a connection to the remote device and opens the Choose Variables dialog

Local variable

Variable in the local application

Contains the remote data

Permission

Access rights of the variables

The respective remote variable has the same access rights.

  • _visu_icon_variable_write_access.png Write permission: Every time the values changes, the variable is updated on the controller.

  • _visu_icon_variable_read_access.png Read permission: Every time the values changes on the controller, the variable is updated in the application.

  • _visu_icon_variable_read_write_access.png Read/Write permission

Note: If you change the access rights, then a download is required for the change to go into effect.

Update always

_cds_icon_option_deactivated.png: The controller data is automatically update (via the data source). A variable is updated automatically if it is used in the visualization, trend, recipe, or as an alarm.

Note: This is the recommended setting type.

standard icon: The variable is updated each cycle.

Note: Select the option only when the variable is used exclusively in IEC code. If a variable is used in the visualization code, then it is updated automatically.

Note: When an instance of a function block or a data type is updated in this way, the instance is always transferred completely.

Create or map

Mapping type for how the remote variable is mapped to the local variable

  • _comm_icon_create_new_variable.png: Mapping to a specific created variable with the data type of the remote variable

    The control data is mapped 1:1. That is the recommended mapping type. The variable is declared in the GVL <name of data source>.

  • _visu_icon_map_to_existing_variable.png: Mapping to an existing variable

    This requires that the existing "remote" variable has the same data type as the local variable. Note the following for this:

    • On the Type Mappings tab, specify the file type name for Local type as it should be used in the local application.

      Example: "yTypeFromLib"

    • But for Remote type, specify the existing type from a library with the namespace (<namespace>.<type>).

      Example: "NS_TypeFromLib.TypeFromLib"

      This is the only way to create the compatible type in the application.

      Example:

      //Code generated by Data Sources.
      //Modifying generated code is not recommended!
      {attribute 'signatureoverload' := 'LibType'}
      {attribute 'signatureoverloadnamespace' := 'NAMESPACE'}TYPE
      TypeFromLib :STRUCT
        iVar : INT;         
        iVar2 : INT;
        iVar3 : INT;
      END_STRUCT
      END_TYPE
      
  • _comm_icon_create_to_existing_variable.png: Mapping to a specific created variable with type-compliant data type to the remote data type: remote and local data types are not the same, but compatible. For example, a type-conforming data type can be available in a library. The variable is declared in the GVL <name of data source>.

Type mapping

Data type of the remote variable

If the variable is not a scalar type, then the type is listed on the Type Mappings tab.

Remote variable

Variable in the remote PLC

Dialog: Choose Variables

Symbol: _visu_icon_update_structured_variables.png

Function: The dialog lists the remote variables that are accessed by means of the configured connection.

Call: Update variables command on the Variables tab.

Requirement: The remote PLC is running. The control application is downloaded.

Variables

The remote variables are listed in the tree view. The top node is identified by the remote application name. Its variables are listed below that. Structured data is listed with all of its subordinate elements.

Example: appControl_A

standard icon: The variable is selected for transferring to the local device. When the variable is structured, it is applied with all subelements. If the variables themselves are subelements, then only this subelement is applied without accepting the structure completely.

Red font: When a variable is displayed in a red font, the variable is not available (anymore) in the remote PLC.

Note: You can click Uncheck unavailable variables to remove the variable from the list.

_cds_icon_option_deactivated.png: The variable is not selected for the transfer.

_cds_icon_plus.png

The variable has expandable elements. By clicking the symbol, the variable is extended by their elements.

Insert the items structured

standard icon: The selected variables are transferred with this structure if they are structured.

_cds_icon_option_deactivated.png: The variable is transferred unstructured with a scalar data type.

Uncheck unavailable variables

Requirement: The link is visible when previously are no longer available in the variable available on the remote PLC. These variables are marked in red in the window above. The symbol configuration or the application presumably changed in the remote PLC.

By clicking the command, the red variables are removed from the list box.