Function sample program, 2 instructions, Binl – Omron SYSMAC CP CP1E-N@@D@-@ User Manual
Page 222

2 Instructions
2-186
CP1E CPU Unit Instructions Reference Manual(W483)
Function
Sample program
When CIO 0.00 is ON in the following example, the 8-digit BCD value in CIO 0010 and CIO 0011 is con-
verted to hexadecimal and stored in D200 and D201.
BIN
BIN(023) converts the BCD data in S to binary data
and writes the result to R.
The following diagram shows an example BCD-to-binary conversion.
BINL
BINL(058) converts the 8-digit BCD data in S and
S+1 to 8-digit hexadecimal (32-bit binary) data and
writes the result to R and R+1.
The following diagram shows an example of 8-digit BCD-to-binary conversion.
(BCD)
(BIN)
R
S
Ч10
3
Ч10
2
Ч10
1
Ч10
0
Ч16
3
Ч16
2
Ч16
1
Ч16
0
R
S
3
4
5
2
0
D
7
C
0
3
4
7
8
11
12
15
0
3
4
7
8
11
12
15
R
R+1
(BCD)
(BCD)
S+1
S
(BIN)
(BIN)
Ч10
3
Ч10
2
Ч10
1
Ч10
0
Ч10
7
Ч10
6
Ч10
5
Ч10
4
S+1
S
Ч16
3
Ч16
2
Ч16
1
Ч16
0
Ч16
7
Ч16
6
Ч16
5
Ч16
4
R+1
R
0
0
0
0
0
0
5
2
0
0
3
0
D
2
7
0
0
Ч10
7
0
Ч10
6
2
Ч10
5
0
Ч10
4
0
Ч10
3
0
Ч10
2
5
Ч10
1
0
Ч10
0
200050=3
Ч16
4
+13
Ч16
2
+7
Ч16
1
+2
Ч16
0
0
Ч16
7
0
Ч16
6
0
Ч16
5
3
Ч164
0
Ч16
3
D
Ч16
2
7
Ч16
1
2
Ч16
0
BINL
10
D200
0.00
R : D200
R+1 : D201
S+1 : CIO 11
S : CIO 10