333
N S
I
T R P
S1
S2
n
D
1
2
M
3
○
FNC
208
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S1
D
S2
n
S1 : the head ID of the searching source character string
S2 : the head ID of the string to be searched
D : the search result
n : to appoint the starting location of the search
INSTR D0 D10 D20 K1
X0
Use the character string to execute a search that is starting from the designated place at the source string
, and the result of the matched location is stored into .
D
S1
S2
n
S2
n
S1
D
D10
D11
D12
D13
00H
20H( )
45H( E)
49H
I
( )
49H
I
( )
4CH( L)
4BH K( )
20H( )
4FH
O
( )
49H
I
( )47H(G)
52H R( )
56H(V)
D14
D15
D16
X0=ON
D20
3
D
D0
D1
D2
00H
45H( E)
49H
I
( )
4CH( L)
4BH K( )
" LIKE"
S1
S2
Since the =1, the search starts from the first one. If the is less than 1,
the instruction will not execute.
If the =5, the search will be starting from the fifth
position of the string . Therefore, the search cannot
find a section who is equal to the , so the result at the
D20 will get 0.
S2
S1
S1
As the example instruction below, the can be substituted by a key-in string between two quotation marks.
The instruction will get the result = D20=8.
D
If the operation has one of the following situation, the PLC will regard that as an operational error.
1. The string from or which does not have the end of string code "00H".
2. The designated starting location is not in the string .
S1
S2
n
S2
Operand
Devices
Search Character String from another
String
Upper
8 bits
Lower
8 bits
When X0 = “ON”, the instruction will be executed as follows:
Upper
8 bits
Lower
8 bits
INSTR “VIGOR” D10 D20 K3
X0
D
S1
S2
n
n n
n