Skip to main content

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.

  1. Select an application in the POU view or device tree and click Project → Add Object.

  2. Select Text List.

  3. Type a name (example: Text_List_A). Click Add to exit the dialog.

    A Text List type object is created.

  4. 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.

  5. 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 ID A.

  6. Double-click in the blank line at the end of the table below Default and type in more text list entries.

    _cds_img_textliste_example.png

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.

  1. Open the text list (example: Text_List_A).

  2. Double-click the visualization.

    The editor opens.

  3. Drag an element (example: Rectangle) to the visualization.

  4. 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 type STRING for the text list name and ID.

    The IEC variables allow for programmatic access to the texts of the text lists.

  5. 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.