Presenting a Snapshot in a Label
This guide will instruct you how to add a Label component, a Snapshot service and bind the output value from the Snapshot service to the Label. The display produced will show the current value of a tag.
Guide for presenting a Snapshot in a Label
-
Create a new Display by clicking the three dots next to an item in the Directory Explorer and selecting New Display.
-
Add a Label component from the Components menu in the Toolbox.
-
Add a Snapshot from the Services menu in the Toolbox. The snapshot will now be visible in the Data Outline.
-
Fetch a Tag
-
Go to Data Outline > Services and select the Snapshot.
-
Click on the plus (+) sign next to the Actions label and select “Fetch Tag” in the dialog box that appears.
Click on the Actions label to make the sub tab Fetch Tag visible and click on Fetch Tag to expand the fields.
Go to the Event parameter and select “Display - On Load”. This will make the tag fetched when the display is opened. -
Go to the Tag Name field under Fetch Tag and click on the tag icon
to the left to search for a tag or enter the name of the tag directly in the field.
The dialog box “Add Tag(s)” opens. Enter the name or part of a name for a tag, by using a wildcard (*), and click the search button
or the Enter key on your keyboard. Select a tag from the list and click the add button. -
Click the play-button-icon
next to the Fetch Tag label to force a fetch of the tag.
Tip: If you want to check if a tag has been fetched you can open the snapshot object in the Data Outline and hover over the attributes to see that it contains information about the selected tag.
-
-
Bind the value from the snapshot to the label. There are two alternative ways to achieve a binding between components:
Binding - Data Outline-
Select the Label component, go to Properties, click in the Label field and delete the default text.
-
Make sure the mouse cursor is still in the Label field. Then Go to Data Outline > Services > the Snapshot object > data > [0] and click on value.
There is now a binding between the value of the Snapshot and the Label field of the Label, which is showed by the text in the Label field. The dark background indicates that there is a binding.
-
Binding - Expression Editor
-
Select the Label component, go to Properties, click in the Label field and delete the default text.
-
Click on the Expression Editor icon
to the right of the Label field to open the Expression Editor.
A dialog box with the Expression Editor now appears.
Go to the menu to the left and open Services > the Snapshot object > data > [0] and click on value to bind it to the Label.
The binding and its value is shown in the window.
Click on Save.There is now a binding between the value of the Snapshot and the Label field of the Label, which is showed by the text in the Label field. The dark background indicates that there is a binding.
Finished Display
We have now added a Label and a Snapshot service. An action has been added to the Snapshot so that it fetches a selected tag and the value of the tag is connected to the Label through a binding. The result is a Display where the current value of the tag is presented in the Label.