beautypg.com

Sample program, 2 instructions, Converting ascii text in scientific notation – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 288

background image

2 Instructions

2-252

CP1E CPU Unit Instructions Reference Manual(W483)

Sample program

Converting ASCII Text in Decimal Notation to Floating-point Data

When CIO 0.00 is ON in the following example, FVAL(449) converts the specified decimal-notation
ASCII text number in the source words starting at D0 to floating-point data and writes the result to des-
tination words D100 and D101.

Converting ASCII Text in Scientific Notation

When CIO 0.00 is ON in the following example, FVAL(449) converts the specified scientific-notation
ASCII text number in the source words starting at D0 to floating-point data and writes the result to des-
tination words D100 and D101.

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

0.00

15

0

D100

D101

20 (Space)

31 (1)
32 (2)
34 (4)
32 (2)

00

D0
D1
D2
D3
D4
D5

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

15

0

FVAL

D0

D100

The 7th and higher digits are ignored.
(The sign, decimal point, and leading
zeroes/spaces are not counted.)

Ignored

Conversion

Storage

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

0.00

15

0

D100

D101

D0
D1
D2
D3
D4
D5
D6

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

15

0

FVAL

D0

D100

1 . 2 3 4 5 E - 0 2

Ignored

Ignored

Conversion

Storage

20 (Space)

This manual is related to the following products: