Character string literals

Character string literals include single byte or double byte encoded characters. A single-byte string literal is a sequence of zero or more characters that are prefixed and terminated by the single quote character ('). In single byte character strings, the three-character combination of the dollar sign ($) followed by two hexadecimal digits is interpreted as the hexadecimal representation of the eight-bit character code as shown in the following table.
TIP:
Character string literals are only applicable to the CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, Compact GuardLogix 5380, and GuardLogix 5580 controllers. Studio 5000 only supports single byte characters.
Character string literals
No.
Description
Example
1a
Empty string (length zero)
''
1b
String of length one or character CHAR containing a single character
'A'
1c
String of length one or character CHAR containing the “space” character
' '
1d
String of length one or character CHAR containing the “single quote” character
'$''
1e
String of length one or character CHAR containing the “double quote” character
'"'
1f
Support of two character combinations
'$R$L'
1g
Support of a character representation with ‘$’ and two hexadecimal characters
'$0A'
Two-character combinations in character strings
No.
Description
Example
1
Dollar sign
$$
2
Single quote
$'
3
Line feed
$L or $I
4
Newline
$N or $n
5
Form feed (page)
$P or $p
6
Carriage return
$R or $r
7
Tabulator
$T or $t
TIP:
The newline character provides an implementation-independent means of defining the end of a line of data for both physical and file I/O; for printing, the effect is that of ending a line of data and resuming printing at the beginning of the next line.
The $' combination is only valid inside single quoted string literals.
Integer literal suffixes
This table lists suffixes you can add to integer literals in Structured Text, and the corresponding range for each suffix.
Suffix
Literal data type
Range
None
DINT
-2,147,483,648 to 2,147,483,648
L
LINT
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,808
U
UDINT
0 to 4,294,967,295
UL
ULINT
0 to 18,446,744,073,709,551,615
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.