Omron SYSMAC CJ - REFERENCE MANUAL 01-2008 Reference Manual page 687

Sysmac cs/cj/one nsj series programmable controllers
Table of Contents

Advertisement

Floating-point Math Instructions
Storage of ASCII Text
648
Scientific notation
15
87
0
Conversion of ASCII text number
2D
20
to 32-bit floating-point data
20
31
2E
32
33
34
45
2B
30
32
00
00
SP SP 1 . 2 3 4 E + 0 2
(2D)(20)(20)(31)(2E)(32)(33)(34)(45)(2D)(31)(38)
Spaces are
ignored during
conversion
The following diagrams show how the ASCII text number is converted to float-
ing-point data. Different conversion methods are used for numbers stored with
decimal notation and scientific notation.
ASCII Character Storage
S
FVAL(449) converts the ASCII characters
starting with the leftmost byte of S and
continuing until a byte containing 00 hex is
reached. There must be a byte containing
00 hex within the first 25 bytes.
00
Decimal notation
15
8
7
0
Sign
(20)
Integer part
Digit
(20)
Sign
SP SP
00
Positive number: Space (20 hex) or Plus sign (2B hex)
Negative number: Minus sign (2D hex)
Scientific notation
15
8
7
0
Sign
(20)
Integer part
Digit
(20)
Sign
. (2E)
Digit
SP
Digit
Sign
E (45)
Digit
Digit
00
Positive number: Space (20 hex) or Plus sign (2B hex)
Negative number: Minus sign (2D hex)
32-bit floating-point data
2
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1
1.234 10
1 1 0 0 0 0 1 0 1 1 1 1 0 1 1 0
Sign
Exponent
15
D
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1
D+1
1 1 0 0 0 0 1 0 1 1 1 1 0 1 1 0
Up to 00 hex
(25 characters max.)
25 characters max.
Fractional part
00
Decimal
The 7th and higher digits are ignored.
point
(The sign, decimal point, and exponent
characters are not counted as digits.)
Any spaces (20 hex) or zeroes (30 hex)
before the first digit are ignored.
25 characters max.
Exponential part
Fractional part
Sign
E
Decimal
point
The 7th and higher digits are ignored.
(The sign, decimal point, and exponent
characters are not counted as digits.)
Any spaces (20 hex) or zeroes (30 hex)
before the first digit are ignored.
Section 3-15
Stored in D and D+1.
0
00
Positive: + (2B hex)
Negative: - (2D hex)
E (45)

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the SYSMAC CJ - REFERENCE MANUAL 01-2008 and is the answer not in the manual?

Questions and answers

Table of Contents