Function - Find position of characters in a string.
IN : STRING
Character string
STR : STRING String containing searched characters
POS : DINT Position of the first character of STR in IN, or 0 if not found
The first valid character position is 1. A return value of 0 means that the STR string has not been found. Search is case sensitive. In LD language, the operation is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung. In IL, the first input (the string) must be loaded in the current result before calling the function. The second argument is the operand of the function.
POS := FIND (IN, STR);
(* The function is executed only if EN is
TRUE *)
(* ENO keeps the same value as EN *)
Op1:
LD IN
FIND STR
ST POS