Mitsubishi Electronics Mitsubishi Digital Electronics Video Gaming Accessories FX3G User Manual

Page of 936
637
FX
3G
/FX
3U
/FX
3UC
 Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.9 FNC208 – INSTR / Character string search
21
FN
C
160
-F
N
C
16
9
R
eal
 T
im
e C
lock
 
C
ont
ro
l
22
FN
C
170-
FN
C
179
E
xte
rnal D
evice
23
FN
C
180
A
lter
nate 
In
st
ru
ct
ions
24
FN
C
181-
FN
C
18
9
O
ther
s
25
FN
C
190-
FN
C
199
B
lock D
ata
 
O
per
ation
26
FN
C2
00
-F
NC
20
9
C
ha
racter
 S
tring 
Co
ntro
l
27
FN
C
210-
FN
C
21
9
Da
ta
 
O
per
ati
on 3
28
FN
C
220-
FN
C
249
Da
ta
 
C
om
par
ison
29
FN
C
25
0-F
N
C
269
D
ata T
abl
O
per
at
ion
30
FN
C
270-
FN
C
274
Ex-
D
ev
ice 
Inv
ert
er
 Com
m
s
4) A character string can be directly specified in the character string 
.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is stored in
D8067.
• When the search start position "n" exceeds the number of characters stored in 
 (error code: K6706)
• When "00H (NULL)" is not located within the corresponding device range starting from 
 (error code: K6706)
• When "00H (NULL)" is not located within the corresponding device range starting from 
 (error code: K6706)
Program example
1) In the program example below, the character string "CI23" (D0 and later) is searched from the 5th character from
the left end (head character) of the character string "CI2312CIM" (R0 and later) when X000 is set to ON. The
search result is stored in D100
  
S
1
42H(B)
41H(A)
+0
b15
+2
+3
+4
b8 b7
b0
"1234AB56AB"
S
2
‚
+1
+5
32H(2)
34H(4)
36H(6)
31H(1)
33H(3)
35H(5)
42H(B)
41H(A)
"AB"
5
D100
Search is started from
the 3rd character (n = 3).
Fifth character from
the head character
Character string
Character string to be searched
S
1
‚
S
2
‚
00H
  
S
2
  
S
1
  
S
2
X000
FNC208
INSTR
D0
R0
D100
K5
R0
b15
R2
R3
R4
b8 b7
b0
"CI2312CIM"
R1
These characters are not
searched because the
search start position is "5".
The search source
character string is searched
from the 5th character.
32H(2)
49H(I)
31H(1)
43H(C)
49H(I)
33H(3)
43H(C)
32H(2)
00H
4DH(M)
D0
b15
b8 b7
b0
"CI23"
D1
D2
0
Because the searched
character string is not
detected, "0" is stored.
49H(I)
33H(3)
43H(C)
32H(2)
00H
D100
END
Character string to be searched R0
Character string D0