Extended instructions
9.2 String and character
S7-1200 Programmable controller
368 System Manual, V4.2, 09/2016, A5E02486680-AK
Table 9- 65 Data types for the parameters
IN2 IN String, WString String of replacement characters
Number of characters to replace
P IN Int Position of first character to be replaced
If parameter L is equal to zero, then the string IN2 is inserted at position P of string IN1
without deleting any characters from string IN1.
If P is equal to one, then the first L characters of string IN1 are replaced with string IN2
characters.
Table 9- 66 ENO status
0 P is greater than length of IN1 IN2 is concatenated with IN1 immediate-
ly following the last IN1 character
P points within IN1, but fewer than L characters remain in IN1 IN2 replaces the end characters of IN1
Resulting string after replacement is larger than maximum length of
OUT string
Resulting string characters are copied
until the maximum length of OUT is
Maximum length of IN1 is 0
IN2 characters are copied to OUT
L is less than 0, or P is less than or equal to 0
Current length is set to 0
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
Maximum length of IN1, IN2 or OUT does not fit within allocated
Maximum length of IN1 or IN2 is 255, or maximum length of OUT is
0 or 255 (String data type)
Maximum length of IN1 or IN2 is 65534, or maximum length of OUT
is 0 or 65534 (WString data type)