![background image](http://html1.mh-extra.com/html/omron/sysmac-cs-series/sysmac-cs-series_reference-manual_742030577.webp)
537
Conversion Instructions
Section 3-12
■
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.
3-12-20 EIGHT-DIGIT NUMBER TO ASCII: STR8(602)
Purpose
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.
4
5
7
6
30
31
32
33
0
1
3
2
34
35
36
37
8
9
B
A
38
39
41
42
15 8
7
11
12 3
4 0
15 8
7 0
NEXT
STR4
,IR0+
FOR
&3
,IR1++
MOVR
D00010
IR0
MOVR
D00100
IR1
00000
000000
000000
S
D
Hexadecimal
S: D00010
S+1: D00011
S+2: D00012
ASCII
D: D00100
D+1: D00101
D+2: D00102
D+3: D00103
D+4: D00104
D+5: D00105
31
32
33
34
BCD
1
2
4
3
15 8
7
11
12 3
4 0
15 8
7 0
STR4
D00010
D00100
BCD
D00000
D00010
000001
S
D
0
4
2
D
15 8
7
11
12 3
4 0
D00000
&1234 Decimal
(#04D2 hexadecimal)
Binary (hexadecimal)
ASCII (BCD)
BCD
S: D00010
D: D00100
D+1: D00101
Содержание SYSMAC CS Series
Страница 2: ......
Страница 4: ...iv ...
Страница 30: ...xxx ...
Страница 186: ...146 List of Instructions by Function Code Section 2 4 ...
Страница 194: ...154 3 35 4 MOVE BIT MOVBC 568 1273 3 35 5 BIT COUNTER BCNTC 621 1275 3 35 6 GET VARIABLE ID GETID 286 1277 ...
Страница 1320: ...1280 Model Conversion Instructions Unit Ver 3 0 or Later Section 3 35 ...
Страница 1390: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...
Страница 1391: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits ...
Страница 1392: ...1352 ASCII Code Table Appendix A ...
Страница 1404: ...1364 Revision History ...