Creating Text in Text Lists and Displaying Dynamically
You can create and translate texts in a text list for dynamic texts in order to display them dynamically in a visualization or in the alarm management. The object of type Text list can be located globally in the POU view or below an application in the device tree. It contains a table with text list entries that you can edit and extend. A text list entry consists of an ID for identification, the output text, and its translation. You can add new text list entries to a text list. Menu commands are provided for this purpose.
Creating text lists for dynamic text display
Requirement: A project with a visualization is open.
Select an application in the POU view or device tree and click
.Select Text List.
Type a name (example:
Text_List_A
). Click Add to exit the dialog.A Text List type object is created.
Click below the Default column and open the input field. Type a text (example:
Information
).The source text is created. It is used as a key in the table and as a source text for translations.
Type any string in the ID column (example:
A
).A text list entry is defined with source text and ID. When you configure the Dynamic texts property of an element in a visualization, you can select the text list
Text_List_A
and assign the IDA
.Double-click in the blank line at the end of the table below Default and type in more text list entries.
Dynamically Displaying a Text
In a visualization, you can configure the dynamic output of texts which were created in a text list by configuring the Dynamic texts property of an element. You can directly assign a text list and an ID, as well as IEC variables, where you set the values programmatically.
Requirement: A project with visualization is open and a text list is in the device tree.
Open the text list (example:
Text_List_A
).Double-click the visualization.
The editor opens.
Drag an element (example: Rectangle) to the visualization.
Configure its Dynamic texts property by selecting one in the Text list property (example:
'Text_List_A'
) and add an ID from the text list into the Text index (example:'A'
). Pay attention to the single straight quotation marks. You can also assign an IEC variable of typeSTRING
for the text list name and ID.The IEC variables allow for programmatic access to the texts of the text lists.
Build the application, download it to the controller, and start it.
The visualization shows the text from the text list in the text field:
Information A
.