101BExtended instructions
8.2 String and character
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
259
Table 8- 67 ENO status
ENO
Condition
OUT
1
No errors detected
Valid characters
P is greater than length of IN1
IN2 is concatenated with IN1
immediately following the last IN1
character
P points within IN1, but fewer than L characters remain in IN1
IN2 replaces the end characters of IN1
beginning at position P
Resulting string after replacement is larger than maximum length of
OUT string
Resulting string characters are copied
until the maximum length of OUT is
reached
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 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
memory range
0
Maximum length of IN1 or IN2 is 255, or maximum length of OUT is
0 or 255
Current length is set to 0
8.2.4.7
FIND
Table 8- 68 Find substring instruction
LAD / FBD
SCL
Description
out := FIND(
in1:=_string_in_,
in2:=_string_in);
Provides the character position of the substring specified by IN2 within
the string IN1. The search starts on the left. The character position of
the first occurrence of IN2 string is returned at OUT. If the string IN2 is
not found in the string IN1, then zero is returned.
Table 8- 69 Data types for the parameters
Parameter and type
Data type
Description
IN1
IN
String
Search inside this string
IN2
IN
String
Search for this string
OUT
OUT
Int
Character position in string IN1 of the first search match