EasyManua.ls Logo

Siemens SIMATIC S7-1200 - Page 131

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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
Total Charac-
ter Count
Current Char-
acter Count
Character 1
Character 2
Character 3
...
Character 10
10
3
'C' (16#43)
'A' (16#41)
'T' (16#54)
...
-
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
Total Charac-
ter Count
Current Char-
acter Count
Character 1
Characters
2 to 299
Character
300
...
Character 500
500 300 'ä' (16#0084) ASCII charac-
ter words
'M' (16#004D) ... -
Word 0 Word 1 Word 2 Words 3 to
300
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
Control char-
acters
ASCII Hex
value (Char)
ASCII Hex
value (WChar)
Control function
Examples
$L or $l
16#0A
16#000A
Line feed
'$LText', '$0AText'
$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'
$P or $p
16#0C
16#000C
Form feed
'$PText', '$0CText'
$R or $r
16#0D
16#000D
Carriage return (CR)
'$RText','$0DText'
$T or $t
16#09
16#0009
Tab
'$TText', '$09Text'
$$
16#24
16#0024
Dollar sign
'100$$', '100$24'
$' 16#27 16#0027 Single quote '$'Text$'','$27Text$
27'

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals