Local HMI Tags
PLCnext Engineer differentiates between HMI tags created from controller variables and local HMI tags. HMI tags created from controller variables are global tags (data variables) that are visible to every station (the controller variables are contained in the controller's Data List). In contrast, local HMI tags are only visible to one client (station), i.e., the tag is associated with a particular client. If a local HMI tag changes, the change only affects the tag of the particular client, i.e., each client using this tag may have a different value for this tag.
PLCnext Engineer allows you to create the following types of local HMI tags:
-
Application local tag: Tag that is specific to one client (station) but shared among all HMI pages in your project. This means, an application local tag is only visible to one client but can be used and seen by all HMI pages in the project. Application tags are initialized when the project (application) is loaded. The tags are created using the 'Tags' editor available for the 'Application' node (subnode of 'HMI Webserver') in the PLANT.
Whenever you create a new project and instantiate a controller, there are the following pre-defined tags added to the 'Tags' editor available for the 'Application' node. These pre-defined tags are read-only (i.e., they cannot be edited, deleted, dragged, etc.), except you can enter a comment. If desired, you can copy a pre-defined tag and create a new user-defined tag.
Pre-defined tag Data type Description ClientNow LDATE_AND_TIME Shows the local time of the client. StationID STRING Shows the station ID of the client. ProjectName STRING Shows the name of the project containing the HMI data that is executed on the client. ActivePage STRING Shows the name of the currently active page. The tag is updated on each page load with the name of the current page. LanguageCode STRING Specifies the language code of the currently active language (for example, en, de, it, etc.) of the HMI application. By writing to the LanguageCode tag, an HMI client is able to switch the HMI language during execution of the application. Preconditions for switching the language are: - A default language and the corresponding alternative language(s) are selected in the 'Options' dialog ('Extras > Options |International | Default Language Settings').
- Translations of the HMI texts are provided in the 'Resources' editor of the 'Application' PLANT node or the 'Resources' editor of the text list editor group.
-
Page local tag: Tag that is specific to the HMI page where it is defined. A page local tag can only be used and seen by the HMI page containing the tag declaration. All other HMI pages in the project do not see the tag. Page local tags are initialized when the relating page is loaded. The tags are created using the 'Tags' editor available for the HMI page node in the PLANT.
The application local and page local tags can be selected in dynamics, bound to the parameters of a symbol instance and used in expressions.
Further Info
For information how to create HMI tags from controller variables, see the topic "HMI Tags Created From Controller Variables". |
'Tags' editor
The 'Tags' editor available for the 'Application' node (located under the 'HMI Webserver' node in the PLANT) and HMI page nodes is used to create and modify the application local and page local tags. With the editor you can:
Use case
Task: The following use case explains the concept of the local HMI tags. In the example application, we have created a visibility checkbox that is connected to the page local tag 'ShowButtons' (see figure 1). The checkbox is used to show or hide a button bar (consisting of two buttons) based on the checkbox selection. The button bar (group of two buttons) has the visibility dynamic assigned. The dynamic is linked to the page local tag 'ShowButtons' (see figure 2).
Result: The button bar disappears only on the client (station) of the user when clearing the checkbox. On all other stations that were connected when clearing the checkbox, the button bar remains visible.
Figure 1: page local tag 'ShowButtons' assigned to checkbox. The checkbox has the value 'True' when checked.
Figure 2: button bar with assigned visibility dynamic linked to 'ShowButtons' tag. The button bar is hidden when the 'ShowButtons' tag has the value 'False' (checkbox is cleared).