EasyManua.ls Logo

Omron CJ - INSTRUCTIONS

Omron CJ - INSTRUCTIONS
1308 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
383
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Conversion Instructions
3
BIN/BINL
Function
Example Programming
When CIO 0.00 is ON in the following example, the 8-digit BCD value in CIO 0010 and CIO 0011 is
converted to hexadecimal and stored in D200 and D201.
z In this example, N words of BCD data is converted to binary data.
If N = 3, the three words of BCD starting from D10 will be converted to binary data one word at a time
when CIO 0.00 turns ON. The resulting binary data will be stored starting from D100.
z 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.
z 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
×10
3
×10
2
×10
1
×10
0
×16
3
×16
2
×16
1
×16
0
R
RR+1
(BCD) (BCD)
S+1 S
(BIN) (BIN)
×10
3
×10
2
×10
1
×10
0
×16
3
×16
2
×16
1
×16
0
×10
7
×10
6
×10
5
×10
4
×16
7
×16
6
×16
5
×
16
4
R+1 R
0020 0050
×10
3
×10
2
×10
1
×10
0
×10
7
×10
6
×10
5
×10
4
0003 0D72
×16
3
×16
2
×16
1
×16
0
×16
7
×16
6
×16
5
×16
4
S+1: CIO 11 S: CIO 10
R+1: D201 R: D200
2000.50=3×16
4
+13×16
2
+7×16
1
+2×16
0
0.00
D200
0.10
BCD#0200
D100
BCD
BIN
BCD#0100
BCD#0300
D101
D102
D10
D11
D12
NEXT
BIN
,IR0+
FOR
&3
,IR1+
MOVR
D10
IR0
MOVR
D100
IR1
0.00
0.00
Decimal &200
Decimal &100
Decimal &300
(Hexadecimal #00C8)
(Hexadecimal #0064)
(Hexadecimal #012C)

Table of Contents

Related product manuals