Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 468

Table of Contents

Advertisement

3. Instructions
Example Programming
Converting 3 Words of Numerical Data to ASCII Data
When CIO 0.00 is ON in the following example, the 3 words of numerical data starting at D10 are
converted, one word at a time, to ASCII data. The converted ASCII data is stored in the DM Area
starting at D100.
0.00
0.00
0.00
S
D
Converting Decimal Data to ASCII Data in BCD Format
When CIO 0.01 is ON in the following example, the source data in D0 (&1234 in decimal) is converted
to BCD data and the result is stored temporarily in D10. Next, the BCD data is converted to ASCII data
and the result is output to D100 and D101.
0.01
S
D
432
MOVR
D10
IR0
S: D10
S+1: D11
S+2: D12
MOVR
D100
Hexadecimal
IR1
FOR
ASCII
&3
D: D100
STR4
D+1: D101
,IR0+
D+2: D102
D+3: D103
,IR1++
D+4: D104
D+5: D105
NEXT
BCD
D0
D0
D10
Binary (hexadecimal)
STR4
D10
BCD
D100
S: D10
BCD
ASCII (BCD)
D: D100
D+1: D101
15
12
11
8
7
4
3
0
1
2
4
5
6
8
9
A
B
15
8
7
30
31
32
33
34
35
36
37
38
39
41
42
15
12
11
8
7
4
3
0
0
4
D
2
15
12
11
8
7
4
3
0
1
2
3
4
15
8
7
0
31
32
33
34
CS/CJ/NSJ Series Instructions Reference Manual (W474)
0
3
7
0
&1234 Decimal
(#04D2 hexadecimal)

Advertisement

Table of Contents
loading

Table of Contents