Eight-Digit Number To Ascii: Str8(602) - Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual

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

Advertisement

Conversion Instructions
000001

3-12-20 EIGHT-DIGIT NUMBER TO ASCII: STR8(602)

Purpose
538
000000
000000
00000
S
D
Example 2: Converting Hexadecimal Data to ASCII Data in BCD Format
When CIO 000001 is ON in the following example, the source data in D00000
(&1234 in decimal) is converted to BCD data and the result is stored tempo-
rarily in D00010. Next, the BCD data is converted to ASCII data and the result
is output to D00100 and D00101.
BCD
D00000
D00000
D00010
Binary (hexadecimal)
STR4
S
D00010
D
D00100
S: D00010
ASCII (BCD)
D: D00100
D+1: D00101
Converts an 8-digit hexadecimal number (#0000 0000 to #FFFF FFFF) to
ASCII data (8 characters).
This instruction is supported by CS/CJ-series CPU Units with unit version 4.0
or later only.
MOVR
D00010
IR0
S: D00010
S+1: D00011
MOVR
S+2: D00012
D00100
Hexadecimal
IR1
FOR
ASCII
&3
D: D00100
STR4
D+1: D00101
,IR0+
D+2: D00102
,IR1++
D+3: D00103
D+4: D00104
D+5: D00105
NEXT
15
12
11
8
7
0
4
BCD
15
12
11
8
7
1
2
BCD
15
8
7
31
33
Section 3-12
15
12
11
8
7
0
1
2
4
5
6
8
9
A
15
8
7
30
32
34
36
38
41
4
3
0
&1234 Decimal
D
2
(#04D2 hexadecimal)
4
3
0
3
4
0
32
34
4
3
0
3
7
B
0
31
33
35
37
39
42

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents