Mitsubishi MELSEC-Q/L Programming Manual page 462

Table of Contents

Advertisement

DABCD, DABCDP, DDABCD, DDABCDP
DDABCD
(1) Converts decimal ASCII data stored in the area starting from the device designated by
it into the area starting from the device designated by
b15
b8
S
ASCII code for millions place
S
+1
ASCII code for ten-thousands place
S
+2
ASCII code for hundreds place
S
+3
ASCII code for units place
For example, if the ASCII code of 87654321
stored at
+1 and
in the following manner:
D
D
b15
b8 b7
37
(7)
S
H
+1
35
(5)
S
H
S
+2
33
(3)
H
S
+3
31
(1)
H
(2) The ASCII data designated at
(3) The ASCII code set at each digit can be in the range of from "30
(4) If ASCII code for individual digits is from "20
Operation Error
(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.
Error
code
4100
A character other than 0 to 9 is put in the data of
The range of the device specified in
4101
corresponding device.
Program Example
(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]
Step
Instruction
[Operation]
b15
b8 b7
D20
34
(4)
H
D21
34
(4)
H
494
460
b7
b0
ASCII code for ten-millions place
ASCII code for hundred-thousands place
b31 b28
ASCII code for thousands place
ASCII code for tens place
is designated for the area starting from
H
b0
38
(8)
H
36
(6)
H
b31 b28
34
(4)
H
32
(2)
H
to
+3 can be in the range of from 0 to 99999999.
S
S
" to "00
H
Error details
.
S
exceeds the range of the
S
Outputs the converted
BCD value to a display device.
Device
b0
20
(space)
H
39
(9)
H
Regarded
as 0494
.
D
D
+1
D
b27
b24
b23 b20
b19
b16
b15 b12
b11
b8
Hundred
Ten
Milli-
Ten
Thou-
Hund-
milli-
ons
thou-
thou-
sands
reds
ons
place
sands
sands
place
place
place
place
place
b27
b24
b23 b20
b19
b16
b15 b12
b11
b8
8
7
6
5
4
3
D
+1
D
" to "39
".
H
H
", it is processed as "30
".
H
H
Q00J/
Q00/
QnH
Q01
––
––
––
Y4F
Y40
0 4 9 4
BCD value
to 8-digit BCD data, and stores
S
b7 b4
b3
b0
Tens
Units
place
place
, the operation results would be
S
b7 b4
b3
b0
2
1
QnPH QnPRH
QnU
––
––
LCPU

Advertisement

Table of Contents
loading

Table of Contents