128
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
5 How to Specify Devices and Constants to Instructions
5.1 Numeric Values Handled in PLCs (Octal, Decimal, Hexadecimal and Real Numbers)
Binary floating point (real number)
When handling a binary floating point (real number) in data registers, use a pair of data registers having serial
device numbers.
When D11 and D10 are used, for example, a binary floating point is handled as shown below:
Binary floating point (real number) =
±
(2
0
+ A22
×
2
−
1
+ A21
×
2
−
2
+ ... + A0
×
2
−
23
)
×
2 (E7
×
2
7
+ E6
×
2
6
+ ... + E0
×
2
0
)/2
127
Example: A22=1 , A21=0, A20=1, A19 to A0=0, E7=1, E6 to E1=0, E0=1
Binary floating point (real number) =
±
(2
0
+ 1
×
2
−
1
+ 0
×
2
−
2
+ 1
×
2
−
3
+ ... + 0
×
2
−
23
)
×
2 (1
×
2
7
+ 0
×
2
6
+ ... + 1
×
2
0
)/2
127
=
±
1. 625
×
2129/2127 =
±
1.625
×
22
The sign bit b31 decide whether data is positive or negative, but is not handled as complement.
Handling of the zero (M8020), borrow (M8021) and carry (M8022) flags
These flags operate as follows in floating point operations.
- Zero flag
: 1 when the result is true 0
- Borrow flag : 1 when the result does not reach the minimum unit but is not 0
- Carry flag
: 1 when the absolute value of the result exceeds the available numeric value range.
Monitoring of binary floating point (real number)
A programming software supporting the display of floating point such as GX Developer can directly monitor
binary floating point (real number).
A programming tool not supporting the display of floating point can monitor binary floating point (real number)
when it is converted into scientific notation (real number).
Scientific notation (real number)
Because binary floating point (real number) is difficult to understand for users, it can be converted into
scientific notation (real number). But internal operations are executed using binary floating point (real
number).
Scientific notation (real number) is handled by a pair of data registers having serial device numbers. Different
from binary floating point (real number), a data register having a smaller device number handles the mantissa
part, and the other data register having a larger device number handles the exponent part.
For example, when data registers D1 and D0 are used, they handle scientific notation as shown below. Data
can be written to D0 and D1 by MOV instruction.
Scientific notation (real number) = [Mantissa D0]
×
10 [Exponent D1]
Mantissa D0 =
±
(1000 to 9999) or 0
Exponent D1 =
−
41 to +35
The most significant bit of D0 and D1 specifies the positive or negative sign respectively, and is handled as
complement of 2 respectively.
The mantissa D0 does not allow "100", for example. In the case of "100", it is handled as "1000
×
10
−
1
".
The scientific notation (real number) range is as follows:
- Minimum absolute value: 1175
×
10
−
41
- Maximum absolute value: 3402
×
10
35
D 10(b15 to b0)
S
E7
E6
E5
E1
E0
A22
A21
A20
A2
A1
A0
2
7
2
6
2
5
2
1
2
0
2
-1
2
-2
2
-3
2
-21
2
-22
2
-23
D 11(b15 to b0)
b30
b31
b29
b28
b23
b24
b22
b21
b2
b1
b0
b20
23 bits in
mantissa part
8 bits in
exponent part
E0 to E7 = 0 or 1
Sign for mantissa part
(0: Positive, 1: Negative)
A0 to A22 = 0 or 1
0 in case of "b0 to b31 = 0"
Содержание FX3U Series
Страница 1: ...PROGRAMMING MANUAL Basic Applied Instructions Edition FX3U FX3UC SERIES PROGRAMMABLE CONTROLLERS ...
Страница 2: ......
Страница 889: ......