Omron CJ - REFERENCE MANUAL 10-2009 Reference Manual page 538

Table of Contents

Advertisement

3. Instructions
• Limits on the Number of Digits in the Integer Part
1) Decimal Notation (C = 0 hex)
• When there is no fractional part (C+2 = 0 hex):
1
Number of Integer Digits
• When there is a fractional part (C+2 = 1 to 7 hex):
1
Number of Integer Digits
2) Scientific Notation (C = 1 hex)
1 digit (fixed)
• Limits on the Number of Digits in the Fractional Part
1) Decimal Notation (C = 0 hex)
• Fractional Digits
• Also: Fractional Digits
2) Scientific Notation (C =1 hex)
• Fractional Digits
• Also: Fractional Digits
Sample program
Converting to ASCII Text in Decimal Notation
When CIO 0.00 is ON in the following example, FSTR(448) converts the floating-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).
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
500
24
(24 - Fractional digits - 2)
7
(Total Number of ASCII Characters - 3)
7
(Total Number of ASCII Characters - 7)
FSTR
D0
D10
D100
Conversion
0
0.327457
Storage
0(Hex)
D10
conditions
7(Hex)
D11
3(Hex)
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
Decimal notation
Total characters = 7 characters
Fractional digits = 3 digits (characters)
Rounded off
CS/CJ/NSJ Series Instructions Reference Manual (W474)

Advertisement

Table of Contents
loading

Table of Contents