Extended instructions
8.2 String and character
S7-1200 Programmable controller
308 System Manual, 03/2014, A5E02486680-AG
Table 8- 54 ENO status
0 Resulting string after concatenation is larger than maximum length of OUT
string
Resulting string characters are
copied until the maximum length
Current length of IN1 exceeds maximum length of IN1, current length of
IN2 exceeds maximum length of IN2, or current length of OUT exceeds
maximum length of OUT (invalid string)
Current length is set to 0
Maximum length of IN1, IN2 or OUT does not fit within allocated memory
Maximum length of IN1 or IN2 is 255, or the maximum length of OUT is 0
LEFT, RIGHT, and MID (Read substrings in a character string) instructions
Table 8- 55 Left, right and middle substring operations
LEFT (Left substring) provides a substring made of the first L
characters of string parameter IN.
•
If L is greater than the current length of the IN string, then the entire
IN string is returned in OUT.
• If an empty string is the input, then an empty string is returned in
OUT.
MID (Middle substring) provides the middle part of a string. The middle
substring is L characters long and starts at character position P
(inclusive).
If the sum of L and P exceeds the current length of the string
parameter IN, then a substring is returned that starts at character
position P and continues to the end of the IN string.
RIGHT (Right substring) provides the last L characters of a string.
•
If L is greater than the current length of the IN string, then the entire
IN string is returned in parameter OUT.
• If an empty string is the input, then an empty string is returned in
OUT.