Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 583

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Conversion Instructions
Examples
000001
S
D
544
Example 1: Converting 3 Sets of 4 ASCII Characters to the Equivalent
Hexadecimal Digits
When CIO 000000 is ON in the following example, the 6 words of ASCII data
starting at D00010 are converted, two words at a time, to numerical data. The
converted numerical data is stored in the DM Area starting at D00100.
000000
MOVR
D00010
000000
MOVR
D00100
000000
S
,IR0++
D
NEXT
Example 2: Converting ASCII Data in BCD Format to Hexadecimal Data
When CIO 000001 is ON in the following example, the ASCII characters in
D00000 and D00001 are converted to BCD data and the result is stored tem-
porarily in D00010. Next, the BCD data is converted to hexadecimal and the
result is output to D00100.
NUM4
D00000
S: D00000
D00010
S+1: D00001
BIN
ASCII (BCD)
D00010
D00100
BCD
D: D00010
BCD
Binary (hexadecimal)
D00100
S: D00010
S+1: D00011
IR0
S+2: D00012
S+3: D00013
S+4: D00014
S+5: D00015
IR1
ASCII
FOR
Hexadecimal
&3
NUM4
D: D00100
D+1: D00101
,IR1+
D+2: D00102
15
8
7
31
33
15
12
11
8
7
3
1
2
15
12
11
8
7
0
4
D
Section 3-12
15
8
7
31
41
38
45
30
30
15
12
11
8
7
1
2
A
8
9
E
0
0
0
0
32
34
4
3
0
4
4
3
0
&1234 Decimal
2
(#04D2 hexadecimal)
0
32
42
39
46
30
30
4
3
0
B
F
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents