Structured Text Programming
Rockwell Automation Publication 1756-RM006K-EN-P - November 2018 521
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.
Tips:
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
Tips:
• 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.
See also
Structured Text Components: Assignments on page 510
Character string literals