Omron NS Programming Manual page 121

Ns-series programmable terminals
Hide thumbs Also See for NS:
Table of Contents

Advertisement

Section 2 NS Series Functions
NS Series Programming Manual
Storage Type
REAL (real number)
BCD2
(unsigned, 1 word)
Example 3: 0010 0000 0110 0000 0000 0000 0000 0000
If the sign, exponent, and mantissa are separated, the number will appear as shown
below.
b31 b30
b23 b22
0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7
6
5
4
3
2
1
0
-1
-2
-3
-4
-5
2
2
2
2
2
2
2
2
2
2
2
2
2
Sign: +
− 127 = 64 − 127 = −63
6
Exponent: 2
-1
-2
Mantissa: 2
+ 2
= 0.5 + 0.25 = 0.75
Real number = (1 + 0.75) × 2
Non-Normalized Numbers and Zero
If the exponent is 0 and the mantissa is a value other than 0, this is called a
non-normalized mantissa. If the exponent is 0 and the mantissa is also 0, this is
called zero.
For non-normalized numbers and zeros, the numeral display and input will be
[0000.0000] (for 4-digit integer and 4-digit decimal display), showing the value as
"0".
Infinity and Non-numbers
If the exponent is 11111111 and the mantissa is 0, this is called infinity. If the ex-
ponent is 11111111 and the mantissa is a value other than 0, this is called a
non-number.
For infinity and non-numbers, the numeral display and input will be [####.####](for
4-digit integer and 4-digit decimal display), showing the value as "#".
For real numbers, 7 digits are enabled. Errors will occur for more than 7 digits.
Example: If 1234567890 is entered when REAL is set for numeral display and input
(10-digit integer section), the value will be displayed and stored as shown below.
Input: 1234567890
Display: 1234567936
↑An error has occurred in the above display for the digits after
the 7
Storage: 0100 1110 1001 0011 0010 1100 0000 0110
Stores as 2-byte BCD at the write destination address.
(0 to 9,999 in decimal)
The data format is described below.
b15
b12 b11
b8 b7
b4 b3
0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1
3
2
1
0
3
2
1
0
3
2
1
0
3
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
Example: 0100 0011 0010 0001
st
0
nd
1
digit: 2
= 1; 2
digit: 2
BCD value: 4321
Values between 0 and 9 can be obtained for each digit. Higher values (A to F) can-
not be expressed in BCD.
The display for numeral display and input will be [####].
2-74
2-8 Common Functional Object Functions
Details
-6
-7
-8
-9
-10
-11
-12
-13
-14
-15
-16
-17
-18
-19
-20
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
= 1.75 × 2
≈ 1.897353 × 10
-63
-63
th
digit.
b0
0
2
1
rd
1
0
= 2; 3
digit: 2
+ 2
= 3; 4
b0
-21
-22
-2 3
2
2
2
-19
th
2
digit: 2
= 4

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents