Adding Tags to Graphics
Scenario
You want to add a text string to your graphics that is linked to a variable. Rather than changing the contents of a text directly, you can update it by changing the value of the tag.
After you create a tag within the Object Configurator, you can include that tag within graphics using the Graphics Editor. Once you link the tag to its object using the tag name, the graphic will display the contents of the tag’s value.
Desigo CC tags have the syntax “Name=Value.” For more information, see Creating Tags for Objects.
Steps
- You are in the Graphics Editor in Engineering mode.
- Create a new text element or select an existing element.
- To invoke a tag within the Graphics Editor, you must first use the correct bracket ( “{}” ) notation. Find the Text Properties pane and select the Text field. The text of the tag name will be contained within the brackets, along with any other text that will be interpreted literally. For example, consider the tag “City=Zurich,” where “City” is the tag name and “Zurich” is the tag value. For the text string “{City} is a city in Switzerland,” the word “City” within brackets refers to the tag name,” and the rest of the sentence will be displayed as-is. When the tag is evaluated and displayed within a graphic, it will read “Zurich is a city in Switzerland.”
- Repeat step two for each tag you want to add. It is possible to add multiple tags in each text element. For example, {CityOne} and {CityTwo} are cities in Switzerland” might evaluate to “Zurich and Geneva are cities in Switzerland.” Under Text Type within Text Properties, select “Tags.”
- The last step is to create a reference to the tag object in the Evaluation Editor. In the Property field, select Text. Next, in the expression field, add an object reference containing the path to the object with the tag. This reference should be wrapped in double quotes, for example “Building1.Floor2.Room202.TemperatureSensor1;”
- At this point, your tag should be linked to the correct object and ready to display in a graphic.