EasyManua.ls Logo

Siemens SIMATIC S7-1200

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...
Extended instructions
9.2 String and character
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
361
Table 9- 46 ATH and HTA condition codes
RET_VAL
(W#16#....)
Description
ENO
0000
No error
TRUE
0007 Invalid ATH input character: A character was found that was not an ASCII character 0-
9, lowercase a to f, or uppercase A to F
FALSE
8101
Illegal or invalid input pointer, for example, an access to a DB that does not exist.
FALSE
8120 Input string is an invalid format, i.e., max= 0, max=255, current>max, or grant length in
pointer < max
FALSE
8182
Input buffer is too small for N
FALSE
8151
Data type not allowed for input buffer
FALSE
8301
Illegal or invalid output pointer, for example, an access to a DB that does not exist.
FALSE
8320 Output string is an invalid format, i.e., max= 0, max=255, current>max, or grant length
in pointer < max
FALSE
8382
Output buffer is too small for N
FALSE
8351
Data type not allowed for output buffer
FALSE
9.2.4
String operation instructions
Your control program can use the following string and character instructions to create
messages for operator display and process logs.
9.2.4.1
MAX_LEN (Maximum length of a character string)
Table 9- 47 Maximum length instruction
LAD / FBD
SCL
Description
out :=
MAX_LEN(in);
MAX_LEN (Maximum length of string) provides the maximum length value
assigned to string IN at output OUT. If errors occur during processing of the
instruction, then an empty string length will be output.
The String and WString data types contain two lengths: the first byte (or word)
gives the maximum length and the second byte (or word) gives the current
length (this is the current number of valid characters).
The maximum length of the character string is assigned for each String or
WString declaration in square brackets. The number of bytes occupied by a
String is 2 bytes greater than the maximum length. The number of words
occupied by a WString is 2 words greater than the maximum length.
The current length represents the number of the characters actually used.
The current length must be less than or equal to the maximum length. The
current length is in bytes for a String and in words for a WString.
Use the MAX_LEN instruction to get the maximum length of the character
string and the LEN instruction to get the current length of a string.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals