7.11 String Processing Instructions
7.11.16 Random selection and replacement in character string data
7-219
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
MIDR, MIDW
MIDR, MIDW
Program Example
(1) In the following program, the 3rd character through the 6th character from the left of the
character string data stored in Var_D10 and the following devices are extracted and stored
to Var_D0 and the following devices when X0 turns ON.
[Structured ladder]
[ST]
MIDRP(X0,Var_D10,Var_R0,Var_D0);
[Operation]
(2) In the following program, the 4 characters of the character string data stored in Var_D0 and
the following devices are extracted and stored to the devices from the 3rd character from the
left of the character string data in Var_D100 and the following devices when X0 turns ON.
[Structured ladder]
[ST]
MIDWP(X0,Var_D0,Var_R0,Var_D100);
[Operation]
3
4
42
H
(
B
)
41
H
(A)
32
H
(2)
31
H
(1)
33
H
(3)
46
H
(E)
"
B
A213E
D
"
45
H
(
D
)
00
H
32
H
(2)
31
H
(1)
33
H
(3)
46
H
(E)
00
H
"213E"
b15
b8b7
b0
b15
b8b7
b0
Var
_R0[1]
Var
_R0[0]
Var
_
D
10
Var
_
D
0
3
4
32
H
(2)
31
H
(1)
46
H
(F)
45
H
(E)
30
H
(0)
33
H
(3)
"
21FE03"
00
H
55
H
(
U
)
53
H
(S)
43
H
(C)
59
H
(Y)
"
U
SCY
Z
10
B
"
5A
H
(
Z
)
31
H
(1)
30
H
(0)
42
H
(
B
)
00
H
Before
execut
i
on
55
H
(
U
)
53
H
(S)
32
H
(2)
31
H
(1)
"
U
S21FE0
B
"
46
H
(F)
45
H
(E)
30
H
(0)
42
H
(
B
)
00
H
A
fter
execut
i
on
b15
b8b7
b0
b15
b8b7
b0
b15
b8b7
b0
Var
_
D
0
Var
_
D
100
Var
_
D
100
Var
_R0[1]
Var
_R0[0]
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......