Using a Visualization as an Element
If you define a frame interface for a visualization and reference it, then this construct behaves like a visualization element:
When creating the frame interface on the Frame Configuration tab, you can define which properties will be public. You can create an interface yourself.
You can categorize the properties and structure them hierarchically to provide for a clear overview.
The visualization can be reused as often as you want, which means that they are referenced by means of a frame in a superordinate visualization.
When the frame is selected there, exactly those properties which were defined in the frame interface are displayed in the Properties view. Now when you configure the properties, you will get help as usual from the editors which are provided in the view. The handling is the same.
If the Forward inputs standard property is configured, then user input is forwarded to the referenced visualization.
For more information, see: Frame Configuration
Configuring a Frame Interface
A visualization which exists in the pool in the POUs view should represent a special Gauge
measurement control. This visualization should be reusable. When reusing, only a few selected properties should have to be configured. That is why the visualization gets a frame interface
Double-click the
Gauge
visualization object.Gauge
is displayed in the visualization editor. The Frame Configuration tab is displayed in the top part. The properties for the frame interface are defined there.Focus on the frame configuration and click Add node.
The new node has the default name Property and has to be configured now.
Double-click the new property in the first column and specify a suitable name, such as
Max
.Double-click the new property in the Editor Type column and select Variable.
Double-click the new property in the Variable Type column and select
INT
.Double-click the new property in the Default Value column and select
250
.Double-click the new property in the Variable column and select
iIn
.The property is linked to the interface variable
iIn
.
The new node is configured.
Add a new
VisGauge
visualization below your application.Drag a frame element to this visualization.
The Frame Configuration dialog opens.
Add the
Gauge
visualization to the Selected visualizations.Gauge
is displayed in the superordinateVisGauge
visualization. In the Properties view, the properties are displayed as defined on the Frame Configuration tab.Figure 3.VisGauge
visualization used as element
Configuring descriptions
To support the application developer, for example, you can configure descriptive texts for the interface, both for the visualization as a whole as well as for each interface property. The texts are managed in text lists. In the frame configuration, the IDs of the text list are then assigned in the Description ID column. Managing the texts in text lists allows you to localize the texts and helps to keep a clear overview.
Alternatively, you could also enter a text directly in the Default Value column. The requirement for this is that the field in the Description ID column is empty. As a result, localization is not possible.
The descriptions are displayed when the application developer selects the referencing frame element in a superordinate visualization. Then, depending on the selected property, the corresponding text appears in the comment window in the Properties view.
Gauge
visualization and its propertiesIn the POUs view, add a text list named
PropertyNames
.Configure an ID for each property which should output a comment:
Click in the blank line of the text list. Open the line editor under the ID column and enter an ID.
Configure a default value for the new ID and localize this value for each language.
The text list is prepared. The texts are referenceable.
Example: Text list with descriptions for the interface
The text with the ID
Element_Desc
is the element description of theGauge
visualization. Typically, the purpose or function is specified here.Switch to the visualization where the texts should be referenced. Make sure that the top part is visible and click the Frame Configuration tab.
The
Gauge
visualization with the frame configuration above is active.In the toolbar, click the
command icon.
Tip
If the command is not available, then an element description already exists in the frame configuration. Only one per frame configuration is allowed.
The Element description entry is inserted at the top position.
Configure the entry:
In the row, click the field in the Description ID column.
The line editor opens and brings the
button to the Input Assistant.
Open the Input Assistant.
Select the
PropertyNames
text list there and then select the IDElement_Desc
. Click OK to close the Input Assistant.Press Enter to confirm your selection.
The description ID is assigned a text list ID. The selected text is automatically displayed below Default Value. This field is no longer editable.
The interface now has an element description.
In the frame configuration, assign a description ID for each property in the Description ID column. Continue as described in the Step 3 step.
Each interface property now has a description.
Reference
Gauge
in another, superordinate visualization.Switch to the Visualization Toolbox view.
Click the Current Project button.
Drag the
Gauge
visualization to the visualization editor.In the Properties view, the interface properties are displayed as configured.
Select the element properties one after the other.
The respective texts are displayed in the comment field below it. In the case of the Element type property, for example, the element description is displayed.
Figure 4. ReferencedGauge
visualization inVisMain