5 SEQUENCE INSTRUCTIONS FOR MOTION CPU
5.4.9 Conversion from BIN to BCD (16 bits, 32bits): BCD, DBCD
Setting
data
X
Y
M
(S)
(D)
[Setting data]
[Function]
Bit device
SM
F
T
C
D
[Instruction]
Command
BCD
Command
DBCD
Setting data
(S)
(D)
(1) Conversion from BIN to BCD (16 bits) (BCD)
• Converts BIN data (0 to 9999) at the device designated by (S) to BCD data, and
stores it at the device designated by (D).
32768
(S) BIN 9999
8000
(D) BCD 9999
Thousands digits
Usable device
Word device
W
T
C
SD
Z
BCD
DBCD
Head number of the devices where the BIN data is stored
Head number of the devices where BCD data will be stored
16384 8192 4096 2048 1024 512 256 128 64
0
0
1
0
0
1
Must always be "0".
4000 2000 1000 800 400 200 100 80
1
0
0
1
1
0
Hundreds digits
5 - 40
Constant
Pointer
Level
K
H
P
N
: Usable
: Only BCD instruction (16 bits)
(S)
(D)
(S)
(D)
Description
(BIN 16/32 bits)
(BCD 4/8 digits)
32
16
1
1
0
0
0
0
BCD conversion
40
20
10
0
1
1
0
0
1
Tens digits
Digit
desig-
Index
nation
8
4
2
1
1
1
1
1
8
4
2
1
1
0
0
1
Ones digits