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

Cp1h/cp1l cpu unit
Table of Contents

Advertisement

Floating-point Math Instructions
Scientific notation (C=0001 hex)
Total number of characters
Fractional
Exponential part
Integer part
part
Sign
Sign
Decimal point
.
E
If there are more fractional digits in the source data than specified in C+1, the extra digits will be rounded off.
If there are fewer fractional digits, zeroes (ASCII: 30 hex) will added to the end of the source data.
A decimal point (ASCII: 2E hex) is added if the number fractional digits is greater than 0.
Spaces (ASCII: 20 hex) are added if the integer part of the floating-point data is shorter than the integer part of the result (total
number of characters - sign digit - decimal point - fractional digits - E digit).
Positive number: Space (20 hex)
Negative number: Minus sign (2D hex)
Note
0 to 9 are written as 00 to 09.
Positive: Plus sign (2B hex)
Negative: Minus sign (2D hex)
Letter E (ASCII: 45 hex) is written here.
Either one or two bytes of zeroes are added to the end of ASCII text as an end
code.
Total number of characters odd: 00 hex is stored after the ASCII text.
Total number of characters even: 0000 hex is stored after the ASCII text.
Limits on the Number of ASCII Characters
There are limits on the number of ASCII characters in the converted number.
The Error Flag will be turned ON if the number of characters exceeds the
maximum allowed.
1. Limits on the Total Number of ASCII Characters
a. Decimal Notation (C = 0000 hex)
• When there is no fractional part (C+2 = 0000 hex):
2
Total Characters
• When there is a fractional part (C+2 = 0001 to 0007 hex):
(Fractional digits + 3)
b. Scientific Notation (C = 0001 hex)
• When there is no fractional part (C+2 = 0000 hex):
6
Total Characters
• When there is a fractional part (C+2 = 0001 to 0007 hex):
(Fractional digits + 7)
2. Limits on the Number of Digits in the Integer Part
a. Decimal Notation (C = 0000 hex)
• When there is no fractional part (C+2 = 0000 hex):
1
Number of Integer Digits
• When there is a fractional part (C+2 = 0001 to 0007 hex):
1
Number of Integer Digits
b. Scientific Notation (C = 0001 hex)
1 digit (fixed)
3. Limits on the Number of Digits in the Fractional Part
a. Decimal Notation (C = 0000 hex)
• Fractional Digits
• Also: Fractional Digits
b. Scientific Notation (C = 0001 hex)
• Fractional Digits
• Also: Fractional Digits
24
Total Characters
24
24
Total Characters
24
24
(24
Fractional digits
7
(Total Number of ASCII Characters
7
(Total Number of ASCII Characters
Section 3-14
2)
3)
3)
519

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents