Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
26 Applied Instructions (Character String Control)
26.9 INSTR / Character string search
648
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Function and operation explanation
1. 16-bit operation (INSTR/INSTRP)
1) The character string stored in the device specified by and later is searched for within the character
string of the device specified by and later. The search begins at the "n"th character from the left end
(head character) of the device specified by and the search result is stored in the device specified by
.
The search result provides the first matching character (located from the left end (head character)) in the
device specified by .
2) When the searched character string is not detected, "0" is stored in the device specified by .
3) When the search start position "n" is a negative number or "0", search processing is not executed.
4) A character string can be directly specified in the character string to search for specified by .
Cautions
1) The instruction is provided in the FX3UC PLC Ver. 2.20 or later.
Command
input
INSTR
EN ENO
d
s1
s2
n
Head device storing search result
Head device storing a character string to search for
Head device storing a character string to be searched
Search start position
+0
+2
+3
+4
"ABCDEFGHIJK"
+1
+5
Search is started from
the 3rd character. (n=3)
5th character from
the head character
46H(F)
48H(H)
45H(E)
47H(G)
42H(B)
44H(D)
41H(A)
43H(C)
4AH(J) 49H(I)
00H 4BH(K)
+0
"EFGH"
+1
+2
5
Stores the position where
the first detected characte
r
is located from the head
character in the character
string data stored in .
46H(F)
48H(H)
45H(E)
47H(G)
00H
Character string to search forCharacter string to be searched
b15 b8 b7 b0
b15 b8 b7 b0
d
s2
s1s2
42H(B)
41H(A)
+0
b15
+2
+3
+4
b8 b7 b0
"1234AB56AB"
+1
+5
Search is started from
the 3rd character. (n=3)
5th character from
he head character
32H(2)
34H(4)
36H(6)
31H(1)
33H(3)
35H(5)
42H(B) 41H(A)
"AB"
5
D100
Character string to search fo
r
Character string to be searched
00H
s2