454
BCDDA, BCDDAP, DBCDDA, DBCDDAP
Program
E
xamp
l
e
(1) The following program uses the PR instruction to convert BCD 4-digit data (the value at W0) to decimal, and outputs it in
ASCII format to Y40 to Y48.
[Ladder Mode]
[List Mode]
[Operation]
Conducts ASCII output of Y40 to Y48 by using the PR instruction when X0 goes ON.
Because SM701 is OFF, The PR instruction will output ASCII code until 00
H
is encountered.
(2) The following program uses the PR instruction to convert BCD 8-digit data (the values at W10 and W11) to decimal, and
outputs it in ASCII format to Y40 to 48.
[Ladder Mode]
[List Mode]
[Operation]
Conducts ASCII output of Y40 to Y48 by using the PR instruction when X0 goes ON.
Because SM701 is OFF, The PR instruction will output ASCII code until 00
H
is encountered.
Step
I
nstruct
i
on
De
vi
ce
D1
D2
31
H
(1)
32
H
(2)
39
H
(9)
35
H
(5)
b15
b8b7
b0
00
H
D0
W0
BCD
v
a
l
ue
PR
Y4
0
to
Y4
8
1
Outputs
"
1295
"
2 9 5
Step
I
nstruct
i
on
De
vi
ce
D1
D2
D3
33
H
(3)
35
H
(5)
3
4
H
(
4
)
37
H
(7)
b15
b8b7
b0
38
H
(8)
33
H
(3)
D0
35
H
(5)
32
H
(2)
00
H
D
4
3
W11
W10
PR
Y4
0
to
Y4
8
Outputs
"
35
4
78352
"
5
4
7 8 3 5 2
BCD
v
a
l
ue