Specifications

7. Application Instructions
© DELTA ELECTRONICS, INC. ALL RIGHTS RESERVED
7-4
Handling of Decimal
The internal operation of DVP PLC usually gets the value of BIN integer.
When operating integer division, the decimal will be erased. For example: 40
Ί3=13, remainder is 1 and the decimal will be erased. But if using decimal
operation, you can get decimal.
The application commands relate to decimal point are shown in the following.
API 49 (FLT) API 110 (D ECMP) API 111 (D EZCP) API 118 (D EBCD)
API 119 (D EBIN) API 120 (D EADD) API 121 (D ESUB) API 122 (D EMUL)
API 123 (D EDIV) API 124 (D EXP) API 125 (D LN) API 126 (D LOG)
API 127 (D ESQR) API 128 (D POW) API 129 (INT) API 130 (D SIN)
API 131 (D COS) API 132 (D TAN)
Floating point of decimal number system
The floating point that DVP-PLC uses is binary number system, you
should convert floating point of binary number system to decimal number
system.
Floating point of decimal number system is stored in the register with 2
continuous numbers. The register with small number stores constant and
the register with greater number stores exponent.
For example, using register (D1, D0) to store a floating point of decimal
number system.
Floating point of decimal number system = [constant D0] X 10
[exponent D1 ]
constant D0 = 1,000 ~ 9,999
exponent D1 = -41 ~ +35
the left-most bit of (D1, D0) is symbol bit.
Besides, constant 100 doesn’ t exist in D0 due to 100 will be shown with
1,000× 10
-1
.
The usage range of decimal floating point is:
Minimum absolute value is 1,175×10
-41
and the maximum absolute value
is 3,402×10
35
.
Floating point of decimal number system can be used in the following
command.
˅ˆʳ˵˼̇̆ʳ̂˹ʳ˸̋̃̂́˸́̇
2
S
ˋʳ˵˼̇̆ʳ̂˹ʳ˶̂́̆̇˴́̇
b31
7
D 0
(
b15 ~ b0
)
D 1
(
b15 ~ b0
)
˘˃̑˘ˊːʳ˃ʳ̂̅ʳ˄ ˔˃̑˔˅˅ʳːʳ˃ʳ̂̅ʳ˄
˦̌̀˵̂˿˼˶ʳ˵˼̇ʳʻʳ˃ˍʳ̃̂̆˼̇˼̉˸ʿʳ˄ˍʳ́˸˺˴̇˼̉˸ʳʼ
̊˻˸́ʳ˵˃̑˵ˆ˄ʳ˼̆ʳ˃ʿʳ̇˻˸ʳ˶̂́̇˸́̇ʳ˼̆ʳ˃ˁ
E7 E5E6 E1 A22E0 A20A21
b30 b29 b28
2
6
2
5
b24 b23 b22 b21 b20
A6 A4A5 A2A3
b6 b5 b4 b3 b2 b1 b0
A1 A0
2
1
2
-1
2
0
2
-2
2
-3
2
-17
222222
-18 -19 -20 -22-21 -23
The floating point of binary number system =
(
)
23210
202212222
×++×+×+± AAA
()
127067
2/202627
2
×++×+×
×
EEE
(For example) A22=1, A21=0, A20=1, A19~A0=0,
E7=1, E6~E1=0, E0=1
The floating point of binary number system =
(
)
233210
202120212
×++×+×+×+±
()
127067
2/212021
2
×++×+×
×
=
127129
2/2625.1 ×± =
2
2625.1 ×±
b31 is the bit for positive/negative sign