PLC concepts
5.4 Data types
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
131
The following example defines a String with maximum character count of 10 and current
character count of 3. This means the String currently contains 3 one-byte characters, but
could be expanded to contain up to 10 one-byte characters.
Table 5- 36 Example of a String data type
Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 ... Byte 11
The following example defines a WString with maximum character count of 500 and current
character count of 300. This means the String currently contains 300 one-word characters,
but could be expanded to contain up to 500 one-word characters.
Table 5- 37 Example of a WString data type
500 300 'ä' (16#0084) ASCII charac-
'M' (16#004D) ... -
Word 0 Word 1 Word 2 Words 3 to
Word 301 ... Word 501
ASCII control characters can be used in Char, Wchar, String and WString data. The
following table shows examples of control character syntax.
Table 5- 38 Valid ASCII control characters
$N or $n 16#0A and
16#0D
16#000A and
16#000D
Line break
The new line shows two
characters in the string.
'$NText',
'$0A$0DText'
$' 16#27 16#0027 Single quote '$'Text$'','$27Text$