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

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Floating-point Math Instructions
Flags
Examples
0.00
15
1 0 1 0 1 0 0 0 0 1 1 1 0 0 1 0
D0
0 0 1 1 1 1 1 0 1 0 1 0 0 1 1 1
D1
520
Name
Label
Error Flag
ER
Equals Flag
=
Converting to ASCII Text in Decimal Notation
When CIO 0.00 is ON in the following example, FSTR(448) converts the float-
ing-point data in D1 and D0 to decimal-notation ASCII text and writes the
ASCII text to the destination words beginning with D100. The contents of the
control words (D10 to D12) specify the details on the data format (decimal
notation, 7 characters total, 3 fractional digits).
FSTR
D0
D10
D100
Conversion
0
0.327457
Storage
D10
conditions
D11
D12
Total number of characters
0 . 3 2 7 4 5 7
Spaces
Fractional part
D100
20 (Space)
20 (Space)
D101
30 (0)
2E (.)
D102
33 (3)
32 (2)
D103
37 (7)
00
Converting to ASCII Text in Scientific Notation
When CIO 0.00 is ON in the following example, FSTR(448) converts the float-
ing-point data in D1 and D0 to scientific-notation ASCII text and writes the
ASCII text to the destination words beginning with D100. The contents of the
control words (D10 to D12) specify the details on the data format (scientific
notation, 11 characters total, 3 fractional digits).
Operation
ON if the data in S+1 and S is not a valid floating-point
number (NaN).
ON if the data in S+1 and S is +
ON if the Data Format setting in C is not 0000 or 0001.
ON if the Total Characters setting in C+1 is not within the
allowed range. (See 1. Limits on the Total Number of
ASCII Characters above for details.)
ON if the Fractional Digits setting in C+2 is not within the
allowed range. (See 3. Limits on the Number of Digits in
the Fractional Part above for details.)
OFF in all other cases.
ON if the conversion result is 0.
OFF in all other cases.
Decimal notation
0000(Hex)
Total characters = 7 characters
0007(Hex)
0003(Hex)
Fractional digits = 3 digits (characters)
Rounded off
Section 3-14
or
.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents