234
BIN, BINP, DBIN, DBINP
Operation Error
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
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 designated value is out
of the available range.
For the BINP/DBINP instruction, the next operation will not be performed until the command (execution condition) is
turned from OFF to ON regardless of the presence/absence of an error.
Program Example
(1) The following program converts the BCD data at X10 to X1B to BIN when X8 is ON, and stores it at D8.
[Ladder Mode]
[List Mode]
(2) The following program converts the BCD data at X10 to X37 to BIN when X8 is ON, and stores it at D0 and D1.
(Addition of the BIN data converted from BCD at X20 to X37 and the BIN data converted from BCD at X10 to X1F)
[Ladder Mode]
[List Mode]
If the data set at X10 to X37 is a BCD value which exceeds 2147483647, the value at D0 and D1 will be a negative value,
because it exceeds the range of numerical values that can be handled by a 32-bit device.
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
When values other than 0 to 9 are specified to any digits of .
S
Programmab
l
e
Contro
ll
er
i
nput
modu
l
e
I
nput
power
supp
ly
BCD
d
i
g
i
ta
l
sw
i
tch
COM
1
2
4
8
10
20
4
0
80
COM
100
200
4
00
800
0
1
0
0
1
1
0
0
0
1
1
0
COM
COM
X1
F
X1
E
X1D
X1C
X1B
X1A
X19
X18
X17
X16
X15
X1
4
X13
X12
X11
X10
Can
be
used
i
n
other
purposes
.
Step
Instruction
Device
Programmab
l
e
Contro
ll
er
Output
Modu
l
e
I
nput
power
supp
ly
BCD
d
i
g
i
ta
l
sw
i
tch
X13
to
X10
X17
to
X1
4
X1B
to
X18
X1
F
to
X1C
X23
to
X20
X27
to
X2
4
X2B
to
X28
X2
F
to
X2C
X33
to
X30
X37
to
X3
4
Step
Instruction
Device