Справочник Пользователя для Mitsubishi Electronics QCPU

Скачать
Страница из 1204
7-239
INSTR(P)
1
2
3
4
6
6
7
8
7
.11 Char
acter
 string processing inst
ructions
7
.11.17 Char
acter string search (IN
S
TR(
P
))
7.11.17  
Character string search (INSTR(P))
INSTR(P)
Function
(1) Searches for the character string data designated by 
 in the area starting from the nth 
character from the left of the character string data designated by 
 and stores the result of 
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 
, is stored.
When n   3
(2) If there is no matching character string data, stores "0" at 
.
: Character string to be searched or head number of the devices where the character string to be searched is 
stored (character string)
: Character string in which a search is performed or head number of the devices where the character string is 
stored (character string)
: Head number of the devices where the result of search will be stored (BIN 16 bits)
 n
: Location to start the search (BIN 16 bits)
Setting 
Data
Internal Devices 
R, ZR
J
\
U
\G
Zn
Constants
Other
Bit
Word
Bit
Word
K, H
$
––
––
––
––
––
––
––
––
––
––
––
n
––
––
Process
High
performance
Redundant Universal
Basic
Command
Command
INSTR
INSTRP
n
n
S1
S2
D
S1
S2
D
INSTR
INSTRP
S1
S2
D
S1
S2
D
S1
S2
D
S2
Searches from the 
3rd character
+1
41
H
 (A)
42
H
 (B)
43
H
 (C)
44
H
 (D)
45
H
 (E)
46
H
 (F)
47
H
 (G)
48
H
 (H)
49
H
 (I)
4A
H
 (J)
4B
H
 (K)
00
H
+2
+3
+4
+5
"ABCDEFGHIJK"
+1
45
H
 (E)
46
H
 (F)
47
H
 (G)
48
H
 (H)
+2
00
H
"EFGH"
5th character from 
the first character
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      .
b15
b8b7
b0
S1
S2
D
b15
b8b7
b0
S2
S2
S2
S2
S2
S1
S1
S2
D