FIND (find sub-string)
The FIND instruction locates and provides the position of sub-strings within strings.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
FIND

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
EN | Input | BOOL | Instruction enable.
Applies to ladder diagram programs. |
In | Input | STRING | Any non-empty string. |
Pat | Input | STRING | Any non-empty string (Pattern). |
FIND | Output | DINT | Output is:
This instruction is case sensitive. |
ENO | Output | BOOL | Enable output. Applies to ladder diagram programs. |
FIND examples
FIND function block diagram example

FIND ladder diagram example

FIND structured text example

(* ST Equivalence: *) complete_string := 'ABCD' + 'EFGH'; (* complete_string is 'ABCDEFGH ' *) found := FIND (complete_string, 'CDEF'); (* found is 3 *)
Results

Provide Feedback