Find String (FIND)

The FIND instruction locates the starting position of a specified string within another string.
The FIND instruction searches the Source string for the Search string. If the instruction finds the Search string, the Result shows the starting position of the Search string within the Source string. Otherwise the Results is zero.
Available Languages
Ladder Diagram
Ladder Diagram_Find String (FIND)_v1
FactoryTalk Design Studio
DSL - Ladder Diagram
FIND(Source,Search,Start,Result);
Operands
There are data conversion rules for mixed data types within an instruction. See Data Conversion.
Ladder Diagram
Operand
Type
Format
Description
Notes
Source
ANY_STRING
Tag
The string to search in
String types are:
  • Default STRING data type with max 82 length of characters for the string.
  • Any new string type you created with configurable length of characters for the string.
Search
ANY_STRING
Tag
The string to find
Start
SINT
INT
DINT
Immediate
tag
The position in Source to start the search
Enter a number between 1 and the DATA size of the Source.
Result
DINT
SINT
INT
Tag
The position in Source where search string was found
Affects Math Status Flags
No
Major/Minor Faults
A minor fault will occur if:
Fault Type
Fault Code
The LEN value of the string tag is greater than the DATA size of the string tag.
4
51
The Start value is invalid, or
the Source string is empty.
4
56
None specific to this instruction. See Common Attributes for operand related faults.
Execution
Ladder Diagram
Condition
Action
Prescan
N/A
Rung-condition-in is false
N/A
Rung-condition-in is true
The instruction executes.
Postscan
N/A
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.