7.11 String Processing Instructions
7.11.3 4-/8-digit BCD data to decimal ASCII data conversion
7-165
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
BCDDA, DB
C
DDA
BCDDA, DBCDDA
(2) In the following program, the 8-digit BCD data in Var_W10 are converted to the decimal
ASCII code data, and the results are output to Y40 to Y48 by the PR instruction. (Global
label Var_D0 is assigned to device D0.)
[Structured ladder]
[ST]
IF SM400 THEN
RST(TRUE,SM701);
DBCDDAP(TRUE,Var_W10,Var_D0);
END_IF;
PR(X0,D0,Y40);
[Operation]
The ASCII code data are output to Y40 to Y48 by the execution of the PR instruction when
X0 turns ON.
Since SM701 is OFF, The PR instruction outputs ASCII code data up to 00
H
.
D
1
D
2
D
3
33
H
(3)
35
H
(5)
34
H
(4)
37
H
(7)
b15
b8b7
b0
38
H
(8)
33
H
(3)
D
0
35
H
(5)
32
H
(2)
00
H
D
4
3
Var
_W10
P
R
Y40
to
Y48
"35478352"
i
s
output
5 4 7 8 3 5 2
B
C
D
va
l
ue
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: ......