You can create and translate texts in a text list for dynamic texts in order to show them dynamically in a visualization or in the alarm management. The object of type “Text list” can be located globally in the POUs 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 output
Requirement: A project is open with a visualization.
-
Select an application in the POUs view or device tree and click “Project Add Object”.
-
Select “Text list”.
-
Type a name (example:
Textliste_A
). Click “Add” to close the dialog.An object of type “Text list” 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. If you configure the “Dynamic texts” property of an element in a visualization, then you can select the text list
Textliste_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.
Displaying text dynamically
In a visualization, you can configure the dynamic output of texts that 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 to the visualization (example: a “Text field”).
-
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
.
See also