String Table Resources

String tables are resources (embedded configuration data) edited with Workbench.

The name entered in the string table as an ID is automatically declared for the compiler.

You could do the same by declaring an array of STRING variables and enter some initial values for all items in the array.

  • String tables provide significant advantages compared to arrays:
    • The editor provides a comfortable view of multiple columns at editing.
    • String tables are loaded in the application code and does not require any further RAM memory unlike declared arrays.
    • The string table editor automatically declares readable IDs for any string item to be used in programs instead of working with hard-coded index values.

  • If the text is too long for the STRING variable when used at runtime, it is truncated.
    Use special $ sequences in strings to specify non printable characters, according to the IEC standard:

    Code

    Meaning

    $'

    A Single quote.

    $$

    A "$" character.

    $L

    A line feed character (ASCII code 10).

    $N

    Carriage return plus line feed characters (ASCII codes 13 and 10).

    $P

    A page break character (ASCII code 12).

    $R

    A carriage return character (ASCII code 13).

    $T

    A tab stop (ASCII code 9).

    $xx

    Any character (xx is the ASCII code expressed on two hexadecimal digits.