Interface editor

The interface editor is used to define interfaces in visualizations. The interfaces are intended for referencing in a frame on another visualization page. The editor is part of the visualization editor and appears in the upper part of the editor as a separate tab next to the editor for the hotkeys configuration and the element list.

Interface declaration

Since a visualization is treated as a function block, the interface editor appears as a normal declaration editor in the upper part of the visualization editor. Input variables, such as frame parameters, can be found here.

Parameter declarations

VAR_INPUT
{attribute 'parameterstringof' := 'bInput'}
sVarName : STRING;
bInput : BOOL;
END_VAR

Example

The ViewData visualization uses the interface stUserData of type ST_UserData. The visualization element GenElemInst_1 of the ViewData visualization is user-based and shows the variable value of stUserData.sName, as programmed in the View properties of GenElemInst_1.

Interface editor 1:

Programming of frame

To program a frame element, proceed as follows:

  1. Add a frame element in your main visualization.
  2. Set the reference to a visualization with interface, which can be stored in a library.
  3. Assign a variable to each frame parameter.

Example

The Frame visualization element references the ViewData visualization. In Properties view, the assignment is listed together with all frame parameters. Click in the value field of a such variable to assign a variable of the same type. MAIN.stHansData is also assigned here.

Interface editor 2:

Updating the frame parameters

If the interface of a visualization that was added to a frame is modified, the dialog shown in the example is opened automatically when the project is saved or compiled, or when an affected object is opened. You can then adjust the frame parameters in this dialog. If the interface of a visualization that originated from a library was modified, the parameters in your project also have to be updated.

Parameter

This column shows the modified parameters in a tree view. First, the visualization is listed, then the corresponding frame with the reference to the modified visualization. Below this, the currently valid parameters are listed, followed by the previous parameters.

Type

This column shows the parameter type.

Value

The value field contains the variable that was assigned to the parameter. Note the color of the field:

  • Beige: This parameter was automatically taken from the previous configuration.
  • Grey: This new parameter has not yet been assigned a value.
  • Green: This new parameter has already been assigned a value.
  • White: There is nothing to configure here.

Edit values

To edit values, select the value field with a mouse click. Click in the field or press the space bar to open a line editor. Or simply start typing, once you have selected the field. To assign a different variable, type its name or select a variable using the input wizard.

An existing value entry can be copied to another field. Select the entry to be copied, use "Copy" and select the field in which you want to insert the entry, then use "Paste".

Confirm the setting in the dialog with "OK". The dialog closes, and the new parameter assignments can be displayed in the References category under Properties view and the corresponding frame element.

Interface editor 3:

Using instance names in the visualization

To use an instance name of a transferred variable within the referenced visualization function block, use the pragma attribute 'parameterstringof', which provides a corresponding string.

Example

The interface of the ViewData visualization has been extended with the variable bLoggedIn:

VAR_IN_OUT
stUserData : ST_UserData;
bLoggedIn : BOOL;
END_VAR

The following dialog for configuring the new parameter appears when a project is compiled or saved:

Interface editor 4:

It contains a comparison between the current and the previous parameters. bLoggedIn was assigned the new value TRUE. Once the dialog has been closed with OK, the new parameters can also be reproduced in the properties of the frame element.

Pragmas

The following two parameters can be used in the interface editor.