Mitsubishi Electronics FX3G Video Gaming Accessories User Manual


 
151
FX3G/
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)
1
Introduction
2
Overview
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
5.1.3 Handling of numeric values in floating point operations
Handling of numeric values in floating point operations
Binary integers are handled inside PLCs.
During division of integers, the answer "40 ÷ 3 = 13 ... 1" is obtained, for example.
During square root extraction operations, decimal points are ignored.
In FX
3G, FX3U and FX3UC PLCs, floating point operations are available to achieve higher accuracy in such operations.
Binary floating point (real number)
When handling a binary floating point (real number) in data registers, use a pair of data registers having consecutive
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 + E6 × 2 + ... + E0 × 2 )
/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 + 0 × 2 + ... + 1 × 2 )
/2
127
= ±1.625 × 2
129
/2
127
= ±1.625 × 2
2
The sign bit b31 states whether data is positive or negative, but is not handled as a complement.
Number of significant figures
The number of significant figures of binary floating point is approximately 7 when expressed in decimal. The binary
floating point range is as follows:
- Least absolute value: 1175494 × 10
-44
- Most absolute value: 3402823 × 10
32
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 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).
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)
b30b31 b29 b28 b23b24 b22 b21 b2 b1 b0b20
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 "b0 to b31 = 0"
7
7
6
60
0