Omron SYSMAC CP Series Instruction & Reference Manual page 222

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Function
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.
15
12
11
8
7
4
3
S
3
4
5
×10
×10
×10
×10
3
2
1
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.
S+1
0
0
2
0
0
0
×10
×10
×10
×10
×10
×10
7
6
5
4
3
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.
0.00
BINL
10
D200
S+1 : CIO 11
0
0
2
0
×10
×10
×10
×10
7
6
5
4
0
0
0
3
×16 4
×16
7
×16
6
×16
5
R+1 : D201
2-186
0
15
12
11
8
7
4
3
0
2
R
0
D
7
C
×16
×16
×16
×16
0
3
2
1
0
R+1
S
5
0
0
0
0
3
0
×10
×10
×16
×16
×16
×16
×16
×16
2
1
0
7
6
5
4
3
S : CIO 10
0
0
5
0
×10
×10
×10
1
×10
0
3
2
0
D
7
2
×16
3
×16
2
×16
1
×16
0
R : D200
S
(BCD)
S+1
S
(BCD)
(BCD)
R
D
7
2
×16
×16
2
1
0
4
1
2
200050=3×16
+13×16
+7×16
+2×16
CP1E CPU Unit Instructions Reference Manual(W483)
R
(BIN)
R+1
R
(BIN)
(BIN)
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents