Panasonic FP Series Programming Manual page 275

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

String instructions
FIND
FIND returns the position at which the second input string first occurs in the first input string. The
Description
result is written into the output variable. If the second input string does not occur in the first input
string, the value ZERO is returned.
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
Availability of FIND (see page 1326)
PLC types
 If the strings are longer than the length defined for the input variables
(input_string_1 and input_string_2) in the field "Type", an error occurs
(see Special Internal Relays for Error Handling).
 The number of steps may vary depending on the PLC and parameters
used, see also Table of Code Intensive Instructions in the online help.
(up to 200 steps)
Data types
Data type
STRING
STRING
INT
Error flags
No.
IEC address
%MX0.900.7
R9007
%MX0.900.8
R9008
In this example, the same POU header is used for all programming languages. For an example
Example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
In this example the input variables (input_string_1 and input_string_2) have been declared.
Instead, you may enter the strings ('Ideas for life' and 'for') directly into the function. The strings
have to be put in inverted commas, both in the POU header and in the function.
Body
Input_string_2 ('for') is searched in input_string_1 ('Ideas for life'). The position of the first
occurrence (7) is written into output_value.
274
Find string's position
I/O
Function
1st input
input string
2nd input
string that is searched for in the input string
output
position at which the string searched for is found
Set
permanently
for an instant
If
 input strings are longer than the length
defined for the input variables in the field
"Type"

Advertisement

Table of Contents
loading

Table of Contents