459
DABCD, DABCDP, DDABCD, DDABCDP
1
2
3
4
4
6
7
8
7.11 Character string processing instructions
7.11.6 DABCD, DABCDP, DDABCD, DDABCDP
(2) The following program converts the hexadecimal, 8-digit ASCII data set at D20 to D23 to BIN values, and stores the
result at D10 and D11.
[Ladder Mode] [List Mode]
[Operation]
: ASCII data to be converted to BCD value or head number of the devices where the ASCII data is stored (character string)
: Head number of the devices where the conversion result will be stored (BCD 4 digits/8 digits)
Function
DABCD
(1) Converts decimal ASCII data stored in the area starting from device number designated by into 4-digit BCD data, and
stores at device number designated by .
For example, if the ASCII code of 8765
H
is designated for the area starting from , the operation results would be stored
at in the following manner:
(2) The ASCII data designated by to +1 can be in the range of from 0 to 9999.
(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 "20
H
" or "00
H
", it is processed as "30
H
".
7.11.6 DABCD, DABCDP Conversion from d ecimal ASCII to BCD 4-digit data
DDABCD, DDABCDP Conversion from decimal ASCII to BCD 8-digit data
7.11.6
DABCD, DABCDP, DDABCD,
DDABCDP
Setting
Data
Internal Devices
R, ZR
J\
U\G
Zn
Constants
$
Other
Bit Word Bit Word
–– –– ––
–– ––
Step Instruction Device
D21
34
H
(4)46
H
(F)
44
H
(D)32
H
(2)
b15 b8
b7
b0
D20
Regarded as 4FD28750H
(1339197264 in decimal
value)
4FD28750
38
H
(8)37
H
(7)
35
H
(5)30
H
(0)
D22
D23
D11
BIN value
D10
7
2
6
4
13391 9
Process
High
performance
Redundant
Universal
LCPU
Basic
Command
Command
P
D
S
D
S
DABCD, DDABCD
DABCDP, DDABCDP
indicates an instruction symbol of DABCD/DDABCD.
S
D
S
D
S
D
Thousands
place
Hundreds
place
Tens
place
Units
place
ASCII code for thousands place
+1
b15 b12 b8b11
b7
b4 b0b3
b15 b8b7 b0
ASCII code for hundreds place
ASCII code for units place
S
S
D
ASCII code for tens place
S
D
876
5
b15 b12 b8b11 b7 b4 b0b3
38
H
(8)37
H
(7)
36
H
(6)35
H
(5)
b8b7 b0
b15
D
+1
S
S
S S