252
BKBIN, BKBINP
Function
(1) Converts BCD data (0 to 9999) n points from device designated by to BIN, and stores result following the device
designated by .
Operation Error
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Program Example
(1) The following program converts, when X20 is turned ON, the BCD data stored at D100 to D102 to BIN and stores the
operation result into the area starting from D200.
[Ladder Mode]
[List Mode]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The nth data from the device specified by is outside the 0 to 9999
range.
4101
The points specified in n exceed those of the corresponding device
specified in or .
The same device is specified in and .
S
D
BIN conversion
0
BIN 1234
0 0 0 0 1 0 0 1 1 0 1 0 0 1 0
0
BIN 5678
0 0 1 0 1 1 0 0 0 1 0 1 1 1 0
0
BIN 1545
0 0 0 0 1 1 0 0 0 0 0 1 0 0 1
+1
n
0
BIN 4321
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 1234
0 0 1 0 0 1 0 0 0 1 1 0 1 0 0
0
BCD 5678
1 0 1 0 1 1 0 0 1 1 1 1 0 0 0
0
BCD 1545
0 0 1 0 1 0 1 0 1 0 0 0 1 0 1
0
BCD 4321
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
D
S
S
S
S
+1
+
(
n
1
)
+2
+
(
n
2
)
D
D
D
D
n
8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
2000 1000 800 400 200 100 80 40 20 10 8 4 2 1
4000
8000
S
S
D
S
D
Step
Instruction
Device