Command 'Interface editor'

 

Symbol: _visu_icon_cmd_interface_editor.png; keyboard shortcut: Alt+F6.

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

Call: Menu bar: Visualization ‣ Interface editor . Alternatively 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 contains 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 are not initialized.

Syntax

<scope>
    ( {attribute '<attribute name>' ( := '<expression>' )? } )?
   <identifier> : <data type>;
END_VAR

<scope> : VAR_INPUT | VAR_OUTPUT | VAR_IN_OUT
// (...)? : Optional

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 receives a reference to the current applica­tion data.

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

Note: In the case of dialogs the data are only written back when the dialog is closed.

Hint: We recommend urgently that you use this scope so that the return of values is possible. In addition, no data need to be copied.

_cds_icon_varinout.png VAR_IN_OUT

Pragma {attribute 'VAR_IN_OUT_AS_POINTER'}

When transferring a pointer to a data object.

As opposed to the VAR_IN_OUT scope (without attribute), the variable changes become effective immediately and not only when the dialog is closed.

Note: Use this scope only if the visualization implements a Dialog.

_cds_icon_var_input.png VAR_INPUT

When transferring data that are only read

Note:

  • If the visualization is executed as an inte­grated visualization, only input variables of a basic data type (scalar type) may be trans­ferred.

  • If the visualization is executed as CODESYS TargetVisu or CODESYS WebVisu, then input variables of any data type (including POUs) can also be trans­ferred.

_cds_icon_var_input.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.

See also