You are here: Core Reference > Coding > Logic > String Values

String Values

If you need to use a text value in your program, you need to define the value as a STRING.

STRING values are used to store text. For example, STRING values are often used to store messages such as descriptions, batch information, and messages that are used with string points in the ClearSCADA database.

STRING values can contain printable and non-printable characters, and have to be enclosed within single quotes like this: 'example'.

Strings allow a maximum of 255 characters unless you specify a different fixed length in the VAR list.

Example:

  • VAR
    • WarningMessage: STRING [60]:= 'Attention. The state has changed';
  • END_VAR

In this example, WarningMessage is the name of the STRING value. STRING [60] instructs the program that the value is a string value and has a maximum of 60 characters. 'Attention. The state has changed' is the value of the string—the text that is stored.

There are special characters that are reserved. These characters allow you to insert a non-printable character, a dollar sign, quotation marks, etc. The special characters are:

Character Code

Description

$<hexadecimal number>

The character that is represented by the
hexadecimal number, for example, '$32' is 2.

$$

A single dollar sign $

$'

A single quote character '

$L or $l

A line feed character

$N or $n

New line character

$P or $p

Form feed, new page

$R or $r

Carriage return character

$T or $t

Tab character


ClearSCADA 2015 R2