Mitsubishi Electronics FX3G User Manual

Page of 964
155
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
5 How to Specify Devices and Constants to Instructions
5.1 Numeric Values Handled in PLC (Octal, Decimal, Hexadecimal and Real Numbers)
1
Introdu
ction
2
Ov
ervi
ew
3
Instruction 
Li
st
4
D
evices 
in Det
ai
l
5
Specifi
ed the
De
vice
 &
 
C
onst
ant
6
Bef
ore
 
Pr
og
ra
mmi
ng
7
Bas
ic 
Instruction
8
FN
C00-FN
C0
9
Program Fl
ow
9
FNC
10-FN
C19
Mov
e & Com
pare
10
FNC
20-FNC
29
Arith. & Lo
gi
Operati
on
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
3S
, FX
3G
, FX
3GC
, FX
3U
 and FX
3UC
 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 Works2 and 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)
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 "b0 to b31 = 0"