Skip to main content

Using static text in GlobalTextList

The global text list is the central location for texts that are displayed in the visualization.

When you configure a text for the first time in visualization element, CODESYS creates the global text list. CODESYS fills in the table as you create more texts. Therefore, the table includes all texts automatically that you create in the project visualizations. CODESYS assigns incremental IDs as integers, beginning at 0.

You can check, update, and align the global text list with the static texts of the visualization. You cannot edit the source text or the ID directly in the table. However, you can replace a source text with another source text by creating and importing a replacement file. Menu commands are provided for this purpose.

Configuring visualization elements with static text

A text in a GlobalTextList can contain a format definition.

Requirement: A project with a visualization is open. The GlobalTextList object contains the texts that are defined in the project visualizations.

  1. Double-click the visualization.

    The editor opens.

  2. Select an element with the Text property (example: Text Field).

  3. Type in some text in the Text property (example: Static Information A).

    CODESYS adds the text to the global text list in the POU view.

Checking GlobalTextList

Requirement: A project with a visualization is open. The GlobalTextList object contains the texts that are defined in the project visualizations.

  1. Double-click the GlobalTextList object in the POUs tree.

    The table opens with the static texts.

  2. Click Text List → Visualization Text IDs.

    CODESYS reports when a source text of the text list does not match the static text that is identified by the ID. The source text in the global text list and the text in the visualization with the same ID do not match.

Updating IDs in GlobalTextList

Requirement: A project with a visualization is open. The GlobalTextList object contains the texts that are defined in the project visualizations.

  1. In the POU tree, double-click the GlobalTextList object.

    The list opens with the text list entries.

  2. Click Text List → Update Visualization Text IDs.

    CODESYS adds text to the global text list when a text in the Static Text property does not match the source text in the project visualizations.

Removing GlobalTextList and creating current IDs again

Requirement: A project with a visualization is open. The GlobalTextList object contains the texts that are defined in the project visualizations.

  1. Right-click the GlobalTextList object in the POUs tree and select the Delete command.

    The object is removed.

  2. Open a visualization.

  3. Click Visualization → Create Global Text List.

    In the POU view, a new GlobalTextList object is created. The global text list contains the static text from the existing project visualizations.

Removing IDs from GlobalTextList

Requirement: A project with a visualization is open. The GlobalTextList object contains the texts that were defined in the project visualizations.

  1. Double-click the GlobalTextList object in the POUs tree.

    The table opens with the texts.

  2. Click Text List → Remove Unused Text List Entries.

    CODESYS removes the text list entries with IDs not referenced in the project visualizations.

Editing GlobalTextList with a replacement file

A replacement file has the CSV format. The first row is a header: defaultold defaultnew REPLACE. The following rows contain the old source texts, the new source texts, and then the REPLACE command. Tabs, commas, and semicolons are permitted separators. A combination of separator characters in a file is not permitted.

Example (tab as separator character)

defaultalt      defaultneu       REPLACE
Information A   Information A1   REPLACE

When you import a replacement file, CODESYS processes the replacement file row by row and performs the specified replacements in the GlobalTextList. In addition, CODESYS replaces the previous text with the replacement text in the visualizations. If the replacement text already exists as static text, then CODESYS recognizes this and harmonizes the static text and leaves only one text list entry.

Requirement: A project is open with a text list or global text.

  1. Double-click the GlobalTextList object.

    The object opens.

  2. Click Text List → Import/Export Text Lists.

    The Import/Export dialog opens.

  3. At the Choose file to compare or to import input field, click _cds_icon_three_dots.png and select the directory and file (example: ReplaceGlobalTextList.csv).

  4. Select the Import replacement file option.

  5. Click OK to exit the dialog.

    The texts in the text lists and the visualizations are replaced.

Example 4. Example

The global text list contains the following source texts:

GlobalTextList          Counter: %i
GlobalTextList          Zähler: %i
GlobalTextList          Information A
GlobalTextList          Information a
GlobalTextList          Information Aa
GlobalTextList          Umschalten

The replacement file contains the following replacements:

defaultalt              defaultneu              REPLACE
Counter: %i             Counter2: %i    REPLACE
Zähler:  %i             Counter2: %i    REPLACE
Information  A  Information A2  REPLACE
Information  a  Information A2  REPLACE
Information Aa  Information A2  REPLACE
Umschalten              Switch2                 REPLACE

CODESYS detects duplicate text list entries and removes them. Afterwards, the global text list contains the following source texts:

_cds_img_textliste_example_replacement.png

The texts in the visualization have been replaced.

_cds_img_textliste_example_replacement_in_visu.png