Instr, Instrp; Character String Search - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

7.11.17 INSTR, INSTRP

Character string search

7.11.17
INSTR, INSTRP
INSTR
INSTRP
: Character string to be searched or head number of the devices where the character string to be searched is stored (character string)
S1
: Character string in which a search is performed or head number of the devices where the character string is stored (character string)
S2
: Head number of the devices where the result of search will be stored (BIN 16 bits)
D
n
: Location to start the search (BIN 16 bits)
Internal Devices
Setting
Data
Bit
Word
––
S1
––
D2
D
n
Function
(1) Searches for the character string data designated by
character string data designated by
As the result of search, the location of match, counted in the number of characters from the first character of the
character string data designated by
When n
3
b15
b8b7
S2
42
(B)
H
+1
S2
44
(D)
H
+2
S2
46
(F)
H
+3
S2
48
(H)
H
+4
S2
4A
(J)
H
+5
S2
00
H
"ABCDEFGHIJK"
(2) If there is no matching character string data, stores "0" at
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Error
code
The value of n exceeds the number of characters for
00
(NULL) does not exist within the corresponding device range after
H
4100
the device specified by
n is negative or 0.
Command
Command
J
\
R, ZR
Bit
S1
and stores the result of search at the device designated by
S2
, is stored.
S2
b0
41
(A)
Searches from the
H
3rd character
43
(C)
H
5th character from
45
(E)
H
the first character
47
(G)
H
49
(I)
H
4B
(K)
H
Error details
.
S2
and
.
S1
S2
High
Basic
performance
INSTR
S1
S2
INSTRP
S1
S2
Zn
U
\G
Word
––
––
in the area starting from the nth character from the left of the
b15
b8b7
S1
46
(F)
H
S1
+1
48
(H)
H
S1
+2
00
"EFGH"
D
5
.
D
Q00J/
Q00/
QnH
Q01
––
INSTR, INSTRP
Process
Redundant Universal
LCPU
n
D
n
D
Constants
Other
K, H
$
––
––
––
––
––
.
D
b0
45
(E)
H
47
(G)
H
H
Stores the position of the
found character, counted
by the number of characters
from the 1st character in
the character string data
designated by
.
S2
QnPH QnPRH
QnU
1
2
3
4
––
––
4
––
––
6
7
8
LCPU
491

Advertisement

Table of Contents
loading

Table of Contents