DVP-ES2/EX2/EC5/SS2/SA2/SX2/SE&TP Operation Manual - Programming
use registers (D1, D0) for storing a binary floating point value as below:
S E7 E6 E5 E1 E0 A22 A21 A20 A6 A5 A4 A3 A2 A1 A0
b0b1b2b3b4b5b6b20b21b22b23b24b28b29b30b31
2 2 2 2 2 2 2 2 2 2 2 2 22 2
7 6 5 1 0 -1 -2 -3 -17 -18 -19 -20 -21 -22 -23
D1(b15~b0) D0(b15~b0)
8 bits of exponent
23 bits of mantissa
Sign bit (0: positive 1: negative)
When b0~b31 is 0, the content is 0.
Hidden decimal point
Decimal Floating Point
Since the binary floating point value is not very user-friendly, we can convert it into a decimal
floating point value for use. However, please note that the floating point operation in DVP-PLC
is still operated in binary floating point format.
The decimal floating point is represented by 2 continuous registers. The register of smaller
number is for the constant while the register of bigger number is for the exponent.
Example: Store a decimal floating point in registers (D1, D0)
Decimal floating point = [constant D0] × 10
[exponent D1 ]
Constant D0 = ±1,000 ~ ±9,999
Exponent D1 = -41 ~ +35
The constant 100 does not exist in D0 because 100 is represented as 1,000 × 10
-1
. The range of
decimal floating point is ±1175 × 10
-41
~ ±3402×10
+35
.
The decimal floating point can be used in the following instructions:
D EBCD: Convert binary floating point to decimal floating point
D EBIN: Convert decimal floating point to binary floating point
Zero flag (M1020), borrow flag (M1021), carry flag (M1022) and the floating point operation
instruction
Zero flag: M1020 = On if the operational result is “0”.
Borrow flag: M1021 = On if the operational result exceeds the minimum unit.
Carry flag: M1022 = On if the absolute value of the operational result exceeds the range of
use.