Command: Interface Editor

Symbol: _visu_icon_cmd_interface_editor.png, Shortcut: Alt+F6

Function: The command opens and closes the Interface Editor tab above the visualization editor.

Call: Visualization → Interface Editor menu Also by clicking on the small down arrow at the top of the visualization editor

Tab: Interface Editor

Symbol: _visu_icon_interface_editor.png

The tab provides an editor for the declaration of interface variables. The editor behaves in a similar way to the declaration editor of a function block, however interface variables do not have an initialization.

Syntax

<scope>
    {attribute ' <attribute name> ' := ' <expression> '}
    <variable name> : <data type>;
END_VAR

Syntax

Description

<scope>

Scope: VAR_INPUT | VAR_OUTPUT | VAR_IN_OUT

{attribute ' <attribute name> '}

Optional

Attribute pragma

:= ' <expression> '

Optional

Attribute value (parameter)

<variable name> : <data type>;

Declaration of the interface variables

[Note] Note

Interface variables do not have an initialization.

Example 39. Example

Declaration in the interface editor

VAR_INPUT
        {attribute 'parameterstringof'}
        sIdentifier : STRING; // String for instance name
        iCounter : INT;
END_VAR
VAR_IN_OUT
        {attribute 'VAR_IN_OUT_AS_POINTER'}
        fbController: FB_Controller;
END_VAR

Scopes

Possible scopes for interfaces of visualizations or dialogs

_cds_icon_varinout.png VAR_IN_OUT

  • When transferring a structure

    When the visualization is instanced, it gets a reference to the current application data.

  • When transferring a control variable, if the variable is written to when a user input is made. Only then can the visualization write to it.

[Note] Note

In the case of dialogs, the data is written back only when the dialog is closed.

[Tip] Tip

Hint: We strongly recommend that you use this scope so that the return of values is possible. Moreover, no data needs to be copied.

_cds_icon_varinout.pngVAR_IN_OUT

Pragma {attribute 'VAR_IN_OUT_AS_POINTER'}

When transferring a pointer to a data object

In contrast to the VAR_IN_OUT scope (without an attribute), the variable changes are effective immediately and not just when the dialog is closed.

[Note] Note

Hint: We strongly recommend that you use this scope so that the return of values is possible. Moreover, no data needs to be copied.

_cds_icon_input_channel.png: VAR_INPUT

When transferring data that will only be read

[Note] Note
  • If the visualization is executed as an integrated visualization, then only input variables of a basic data type (scalar type) are permitted to be transferred.

  • If the visualization is executed as a or , then input variables of any data type (including POUs) can also be transferred.

_cds_icon_input_channel.png: VAR_INPUT

Pragma {attribute 'parameterstringof'}

When transferring a variable (data type STRING) for the instance name of the transfer parameter specified in the attribute.