Omron CP - PROGRAMMING MANUAL 05-2007 Programming Manual page 557

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Floating-point Math Instructions
Examples
524
Converting ASCII Text in Decimal Notation to Floating-point Data
When CIO 0.00 is ON in the following example, FVAL(449) converts the spec-
ified decimal-notation ASCII text number in the source words starting at D0 to
floating-point data and writes the result to destination words D100 and D101.
0.00
FVAL
D0
D100
The 7th and higher digits are ignored.
(The sign, decimal point, and leading
zeroes/spaces are not counted.)
Ignored
0 1 . 2 3 4 5 2 1
Conversion
D0
2D ( )
20 (Space)
D1
30 (0)
31 (1)
D2
2E (.)
32 (2)
D3
33 (3)
34 (4)
D4
35 (5)
32 (2)
D5
31 (1)
00
Converting ASCII Text in Scientific Notation
When CIO 0.00 is ON in the following example, FVAL(449) converts the spec-
ified scientific-notation ASCII text number in the source words starting at D0
to floating-point data and writes the result to destination words D100 and
D101.
0.00
FVAL
D0
D100
Ignored
Ignored
1 . 2 3 4 5 E - 0 2
Conversion
D0
2D ( )
20 (Space)
D1
31 (1)
2E (.)
D2
32 (2)
33 (3)
D3
34 (4)
35 (5)
D4
45 (E)
2D ( )
D5
30 (0)
32 (2)
D6
00
00
15
0
0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0
1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 0
Storage
15
0
0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0
D100
1 0 1 1 1 1 1 1 1 0 0 1 1 1 1 0
D101
15
0
0 1 0 0 0 0 1 0 1 0 1 0 1 1 1 1
1 0 1 1 1 1 0 0 0 1 0 0 1 0 1 0
Storage
15
0
0 1 0 0 0 0 1 0 1 0 1 0 1 1 1 1
D100
1 0 1 1 1 1 0 0 0 1 0 0 1 0 1 0
D101
Section 3-14

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents