460
DABCD, DABCDP, DDABCD, DDABCDP
DDABCD
(1) Converts decimal ASCII data stored in the area starting from the device designated by to 8-digit BCD data, and stores
it into the area starting from the device designated by .
For example, if the ASCII code of 87654321
H
is designated for the area starting from , the operation results would be
stored at +1 and in the following manner:
(2) The ASCII data designated at to +3 can be in the range of from 0 to 99999999.
(3) The ASCII code set at each digit can be in the range of from "30
H
" to "39
H
".
(4) If ASCII code for individual digits is from "20
H
" to "00
H
", it is processed as "30
H
".
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Program
E
xamp
l
e
(1) The following program converts the decimal ASCII data set from D20 to D22 to BCD 4-digit data, and outputs the results
to Y40 to Y4F.
[Ladder Mode]
[List Mode]
[Operation]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
A character other than 0 to 9 is put in the data of .
––
4101
The range of the device specified in exceeds the range of the
corresponding device.
––
––
––
––
S
D
Ten
milli-
ons
place
ASCII code for ten-millions place
ASCII code for millions place
ASCII code for ten-thousands place
b8
b0
ASCII code for thousands place
ASCII code for hundreds place
ASCII code for tens place
ASCII code for units place
Milli-
ons
place
Hundred
thou-
sands
place
Ten
thou-
sands
place
Thou-
sands
place
Hund-
reds
place
U
nits
place
Tens
place
b31 b28
b24
b27
b16
b19
b23 b20
b15 b12
b0
b3
b7 b4
b8
b11
+1
D
+1
+2
+3
S
S
S
S
b15
b7
D
ASCII code for hundred-thousands place
S
D
D
b31 b28
b2
4
b27
b16
b19
b23 b20
b15 b12
38
H
(8)
37
H
(7)
36
H
(6)
35
H
(5)
b15
b8 b7
b0
3
4
H
(
4
)
33
H
(3)
32
H
(2)
31
H
(1)
b0
b3
b7
b
4
b8
b11
+
1
8
7
6
5
4
3
2
1
D
+
1
+
2
+
3
S
S
S
S
D
S
S
S
S
Outputs
the
con
v
erted
BCD
v
a
l
ue
to
a
d
i
sp
l
ay
de
vi
ce
.
Step
I
nstruct
i
on
De
vi
ce
D21
20
H
(space)
3
4
H
(
4
)
39
H
(9)
3
4
H
(
4
)
b15
b8 b7
b0
D20
BCD
v
a
l
ue
0
4
9
4
Y4F
Y4
0
4
9
4
Regarded
as
0
4
9
4