Omron SYSMAC CS Series Instruction & Reference Manual page 387

Hide thumbs Also See for SYSMAC CS Series:
Table of Contents

Advertisement

Example Programming
 Converting 3 Sets of 4 ASCII Characters to the Equivalent Hexadecimal Digits
When CIO 0.00 is ON in the following example, the 6 words of ASCII data starting at D10 are
converted, two words at a time, to numerical data. The converted numerical data is stored in the DM
Area starting at D100.
0.00
0.00
0.00
S
D
 Converting ASCII Data in BCD Format to Hexadecimal Data
When CIO 0.01 is ON in the following example, the ASCII characters in D0 and D1 are converted to
BCD data and the result is stored temporarily in D10. Next, the BCD data is converted to hexadecimal
and the result is output to D100.
0.01
S
D
CS/CJ/NSJ Series Instructions Reference Manual (W474)
MOVR
S: D10
D10
S+1: D11
IR0
S+2: D12
S+3: D13
MOVR
S+4: D14
D100
S+5: D15
IR1
ASCII
FOR
Hexadecimal
&3
NUM4
D: D100
,IR0++
D+1: D101
,IR1+
D+2: D102
NEXT
NUM4
D0
S: D0
D10
S+1: D1
BIN
ASCII (BCD)
D10
D100
BCD
D: D10
BCD
Binary (hexadecimal)
D100
15
8
7
31
32
41
42
38
39
45
46
30
30
30
30
15
12
11
8
7
4
3
1
2
A
B
8
9
E
F
0
0
0
0
15
8
0
7
31
32
33
34
15
12
11
8
7
4
3
0
3
1
2
4
15
12
11
8
7
4
3
0
0
4
D
2
3. Instructions
0
0
&1234 Decimal
(#04D2 hexadecimal)
353
3

Advertisement

Table of Contents
loading

Table of Contents