How to use the Reference Tag types to open displays.

How-to ExamplesFeatureUNS → Tag Reference



Download the solution: Tag Reference Display Open Example.dbsln

This example demonstrates the use of the Reference Tag type to open displays.






Overview

When you click any of the buttons, a display will open and a reference tag will be linked to the corresponding machine. This way, you can use a single display for all machines — instead of creating one per machine — simply by changing the reference tag.

The buttons are also implemented as Symbols for easier maintenance. For a better understanding, right-click a button, select Edit Symbol, and explore Settings → Label Text and Dynamics → Action.


Data Model (UNS)

UserType: Machine

All machines share the same UserType, which defines the following process variables:

Member

Type

Temperature

Integer

Pressure

Integer

Power

Integer

Tags

Tag

Type

Domain

Description

Machine1

Machine

Server

Instance of the Machine UserType

Machine2

Machine

Server

Instance of the Machine UserType

Machine3

Machine

Server

Instance of the Machine UserType

RefMachine

Reference (Machine)

Server

Reference tag — points to whichever machine is currently selected

EquipNumber

Integer

Server

Drives the reference tag during Previous/Next navigation

Simulated Values

Machine

All Process Variables

Machine 1

10

Machine 2

20

Machine 3

30


Displays

MainPage

The home screen. Contains three instances of the MyButton symbol, one per machine.

Each symbol instance receives two inputs:

SymbolLabel

Value

Equipment

@Tag.Machine1 / @Tag.Machine2 / @Tag.Machine3

EquipmentNumber

1 / 2 / 3


Open the MachineStatus display

When clicked, the button:

  1. Sets @Tag.RefMachine.Link to the name of the selected machine tag
  2. Sets @Tag.EquipNumber to the corresponding machine number
  3. Opens the MachineStatus display

MachineStatus (Shared Display)

This is the single shared display used for all machines. All bindings reference RefMachine, never a specific machine tag directly.

Element

Binding

Temperature TextBox

@Tag.RefMachine.Temperature

Pressure TextBox

@Tag.RefMachine.Pressure

Power TextBox

@Tag.RefMachine.Power

Because all bindings go through RefMachine, the same display automatically reflects whichever machine is currently linked — no duplication required.


MyButton Symbol

The buttons on MainPage are instances of the MyButton symbol. Using a Symbol instead of a plain button means any visual or behavioral change made to the symbol definition is automatically applied to every instance across all displays.

Symbol Labels (Inputs)

Label

Description

Equipment

Tag reference for the target machine (e.g. @Tag.Machine1)

EquipmentNumber

Integer identifying the machine (e.g. 1, 2, 3)

Action Dynamic (on click)

The button executes three expressions on MouseLeftButtonDown:

Expression

Result

#Equipment:(@Tag.Machine1).GetName()

Written to @Tag.RefMachine.Link — links the reference tag to the selected machine

#EquipmentNumber:1

Written to @Tag.EquipNumber — updates the current equipment number

@Display.MachineStatus.Open()

Opens the MachineStatus display

Dynamic Label

The button label is built at runtime:

{#Equipment:(@Tag.Machine1).GetName().Replace("Tag.", "")}

This strips the Tag. prefix so the button displays a clean name like Machine1.

To inspect the symbol configuration: right-click any button → Edit Symbol, then check Settings → Label Text and Dynamics → Action.


Navigation Header (Previous / Next)

The Header display includes Previous and Next buttons that are only visible when the MachineStatus display is open. They allow the operator to cycle through machines sequentially without returning to the main page.

An EquipNumber tag (Integer) drives the reference tag change.

Next Button Action

Expression

Result

TK.IIf(@Tag.EquipNumber > 2, 1, @Tag.EquipNumber + 1)

Written to @Tag.EquipNumber — increments with wrap-around

"Tag.Machine" + @Tag.EquipNumber.ToString()

Written to @Tag.RefMachine.Link — updates the reference tag

Previous Button Action

Expression

Result

TK.IIf(@Tag.EquipNumber < 2, 1, @Tag.EquipNumber - 1)

Written to @Tag.EquipNumber — decrements with wrap-around

"Tag.Machine" + @Tag.EquipNumber.ToString()

Written to @Tag.RefMachine.Link — updates the reference tag

Both buttons use VisibilityDynamic with condition:

@Display.MachineStatus.IsOpened == true

So they only appear when the MachineStatus page is active.


In this section...