Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.9 INSTR / Character string search
649
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
21
Applied Instructions
(Real Time
Clock Control)
22
Applied Instructions
(External Device)
23
Applied Instructions
(Extension
Function)
24
Applied Instructions
(Others)
25
Applied Instructions
(Block Data
Operation)
26
Applied Instructions
(Character
String Control)
27
Applied Instructions
(Data Operation 3)
28
Applied Instructions
(Data Comparison)
29
Applied Instructions
(Data Table
Operation)
30
Applied Instructions
(External Device
Communication)
Error
An operation error is caused in the following cases. The error flag M8067 turns ON, and the error code is
stored in D8067.
1) When the search start position "n" exceeds the number of characters stored in
(Error code: K6706)
2) When "00H (NULL)" is not located within the corresponding device range starting from the device
specified by .
(Error code: K6706)
3) When "00H (NULL)" is not located within the corresponding device range starting from the device
specified by .
(Error code: K6706)
Program examples
1) In the program example below, the character string "C123" (D0 and later) is searched from the fifth
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.
X000
INSTR
EN ENO
d
s1
s2
n
D100
D0
R0
K5
[Structured ladder/FBD] [ST]
INSTR(X000,D0,R0,K5,D100);
R0
b15
R2
R3
R4
b8 b7 b0
"CI2312CIM"
R1
These characters are not
searched because the
search start position is "5".
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
Character string to search forCharacter string to be searched
D100