6.3 Data Conversion Instructions
6.3.2 4-/8-digit BCD data to BIN data conversion
6-69
6
BA
S
IC
INSTRUCTIONS
B
IN
, DB
IN
BIN, DBIN
DBIN(P)
Converts the BCD data (0 to 99999999) in the device specified for
to the BIN data, and stores
the result to the device specified for
.
O
p
erat
i
on
E
rror
In the following case, an operation error occurs, the error flag (SM0) is turned ON, and the
corresponding error code is stored to SD0.
• Values other than 0 to 9 are specified for each digit of
.
(Error code: 4100)
[When using the QCPU]
When the QCPU is used, the error above can be suppressed by turning ON SM722.
However, the instruction is not executed regardless of whether SM722 is turned ON or OFF
if the specified value is out of the available range.
For the BINP and DBINP instruction, the next operation will not be performed until the
command (executing condition) is turned from OFF to ON regardless of the presence or
absence of an error.
Program
E
xam
pl
e
(1) In the following program, the BCD data in X10 to X1B are converted to the BIN data when X8
turns ON, and the result is stored to Var_D8.
[Structured ladder]
[ST]
BINP(X8,K3X10,Var_D8);
s
d
0
BCD 99999999
1
0
1 1
0 0
1 1
0 0
1 1
0 0
1 1
0 0
1 1
0 0
1 1
0 0
1 1
0 0
1
BIN conversion
0
BIN 99999999
Al
w
ays
f
illed
w
it
h
0s.
0
0 0 0
1
0
1 1 1 1 1
0
1
0
1 1 1 1
0 0 0 0 0
1 1 1 1 1 1 1 1
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
1
2
4
8
s
d
1
0
7
1
0
6
1
0
5
1
0
4
1
0
3
1
0
2
1
0
1
1
0
0
2
3
1
2
30
2
2
9
2
2
8
2
2
7
2
26
2
25
2
2
4
2
2
3
2
22
2
21
2
2
0
2
1
9
2
1
8
2
1
7
2
16
2
15
2
1
4
2
1
3
2
12
2
11
2
1
0
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
s
d
Ten
million’s
p
lace
Million’s
p
lace
Hundred
t
h
ousand’s
p
lace
Ten
t
h
ousand’s
p
lace
T
h
ousand’s
p
lace
Hundred’s
p
lace
Ten’s
p
lace
U
nit’s
p
lace
s
Programma
b
le controller in
p
ut module
In
p
ut
p
o
w
er su
pp
ly
BCD digital s
w
itc
h
COM
1
2
4
8
1
0
2
0
40
80
COM
1
00
2
00
400
800
0
1
0
0
1
1
0
0
0
1
1
0
COM
COM
X1
F
X1
E
X1
D
X1
C
X1
B
X1
A
X1
9
X1
8
X1
7
X16
X15
X1
4
X1
3
X12
X11
X1
0
Can
b
e used
in ot
h
er
p
ur
p
oses.
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: ......