Character String Search (Instr(P)) - Mitsubishi MELSEC Q Series Programming Manual

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

INSTR(P)
7.11.17

Character string search (INSTR(P))

INSTR(P)
INSTR
INSTRP
Setting
Data
S1
S2
D
n
Function
(1) Searches for the character string data designated by
character from the left of the character string data designated by
search at the device 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
b15
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
7-238
Command
Command
: Character string to be searched or head number of the devices where the character string to be searched is
S1
stored (character string)
: Character string in which a search is performed or head number of the devices where the character string is
S2
stored (character string)
: 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
R, ZR
Bit
Word
––
––
3
b8b7
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
High
Basic
performance
INSTR
S1
S2
INSTRP
S1
S2
J
\
U
\G
Bit
Word
––
––
in the area starting from the nth
S1
.
D
, is stored.
S2
b15
b8b7
S1
46
(F)
H
S1
+1
48
(H)
H
S1
+2
"EFGH"
D
.
D
Process
Redundant Universal
LCPU
n
D
n
D
Constants
Zn
Other
K, H
$
––
––
––
––
––
––
––
––
––
and stores the result of
S2
b0
45
(E)
H
47
(G)
H
00
H
5
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

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents