String tables are resources (embedded configuration data) edited with the Workbench Studio. A string table is a list of items identified by a name and referring to one or more character strings.

info Information

If a recipe column should be send to the target and the selected type size exeeds 950 bytes and/or 50 variables, the values gets initialized in different cycles.

String tables are typically used for defining static texts to be used in the application. The following functions can be used for getting access to string tables in the programs:

In addition, each string table may contain several columns of texts for each item, and thus ease the localization of application, simply by defining a column for each language. This way the language can be selected dynamically at Runtime Service, simply by specifying the active language (as a column) in the StringTable() function.

The name entered in the string table as an "ID" is automatically declared for the compiler and can directly be passed to the LoadString() function without re-declaring it. The name must conform to IEC standard naming rules.

Obviously, you could do the same by declaring an array of STRING variables and enter some initial values for all items in the array. By the way, string tables provide significant advantages compared to arrays:

  • The zenon Logicprovides 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 for you readable IDs for any string item to be used in programs instead of working with hard-coded index values.

info Information

If the text is too long for the STRING variable when used at Runtime Service, it is truncated.

You can use special '$' sequences in strings in order to specify non printable characters, according to the IEC standard:

Code

Meaning

$$
$'
$T
$R
$L
$N
$P
$xx

A "$" character.
A single quote.
A tab stop (ASCII code 9).
A carriage return character (ASCII code 13).
A line feed character (ASCII code 10).
Carriage return plus line feed characters (ASCII codes 13 and 10).
A page break character (ASCII code 12).
Any character (xx is the ASCII code expressed on two hexadecimal digits.

 

String table resources

IEC 61131-3 Automation platform > IEC 61131-3 Programming Environment > Resources > String table resources

Previous chapterNext chapter


Created with the Personal Edition of HelpNDoc: Easy CHM and documentation editor