6-98
6.3 Data Conversion Instructions
6.3.14 16-bit BIN block data to 4-digit BCD block data conversion
BKBCD
F
unct
i
on
(1) Converts the BIN data (0 to 9999) n points from the device specified for
to the BCD data,
and stores the results to the device specified for
and the following devices.
O
p
erat
i
on
E
rror
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The range of n points from the device specified for
,
exceeds the
corresponding device.
(Error code: 4101)
• The data n points from the device specified for
is outside the range of 0 to 9999. (Error
code: 4100)
• The device ranges of
and
overlap.
(Error code: 4101)
s
d
BCD conversion
0
BIN
12
34
0 0 0 0
1
0 0
1 1
0
1
0 0
1
0
0
BIN
56
78
0 0
1
0
1 1
0 0 0
1
0
1 1 1
0
0
BIN
15
4
5
0 0 0 0
1 1
0 0 0 0 0
1
0 0
1
+
1
n
Must al
w
ays
b
e "0".
0
BIN 43
21
0 0
1
0 0 0 0
1 1 1
0 0 0 0
1
0
BIN
5555
0 0
1
0
1
0
1 1
0
1 1
0 0
1 1
+(n
1
)
+
2
+(n
2
)
0
BCD
12
34
0 0
1
0 0
1
0 0 0
1 1
0
1
0 0
0
BCD
56
78
1
0
1
0
1 1
0 0
1 1 1 1
0 0 0
0
BCD
15
4
5
0 0
1
0
1
0
1
0
1
0 0 0
1
0
1
0
BCD 43
21
1
0 0 0 0
1 1
0 0
1
0 0 0 0
1
0
BCD
5555
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
s
s
s
s
s
+
1
+(n
1
)
+
2
+(n
2
)
d
d
d
d
d
n
8
1
9
2
409
6
2
048
1
0
2
4
512 256 12
8
6
4
3
2
16
8 4
2 1
2
000
1
000
800 400
2
00
1
00
80 40
2
0
1
0
8 4
2 1
4000
8000
s
d
s
s
d
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......