Extended instructions
9.2 String and character
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
367
Table 9- 63 ENO status
0 P is greater than length of IN1 IN2 is concatenated with IN1 immediate-
ly following the last IN1 character
Current length is set to 0
Resulting string after insertion is larger than maximum length of
OUT string
Resulting string characters are copied
until the maximum length of OUT is
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
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)
REPLACE (Replace characters in a character string)
Table 9- 64 Replace substring instruction
in1:=_string_in_,
in2:=_string_in_,
L:=_int_in_,
p:=_int_in);
Replaces L characters in the string parameter IN1. Replacement
starts at string IN1 character position P (inclusive), with replace-
ment characters coming from the string parameter IN2.