DVP15MC11T Operation Manual
8.14.8 FIND
FB/FC
Explanation
FC
FIND searches for the position of a specified string in another string. DVP15MC11T
Parameters
Meaning
Description Valid range
In1 String Input String
Depends on the data type of the
variable that the input parameter is
In2
Key characters to
search for
Input
Key characters to
search for
Depends on the data type of the
variable that the input parameter is
Out
Number of
characters
Output
Number of
characters
Depends on the data type of the
variable that the output parameter is
Boolean
Bit string Integer
Real
number
Time, date
String
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In1
●
In2
●
Out
●
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data type.
Function Explanation
The Find instruction takes the characters in In2 as key characters and searches for the position of
key characters in the string In1. For example, as In1 is ABCDEFGH and In2 is DE, the value of Out
is 4.
The search starts from the first character in the string In1.
If multiple In2 strings exist in In1, the value of Out is the position of the first In2 from the beginning of
In1.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software if the
input variables are omitted. But the output variable is allowed to omit.
Programming Example
The FIND_In1 string is ’AaBbCcDd’ and the FIND_In2 string is ’Cc’. As FIND_EN is TRUE, the
value of Out1 is 5.
8-200