5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-71
API
Applicable model
20PM
49
D
D
FLT
P
P
Converting a binary integer into a binary
floating-point value
Bit device Word device
X Y M S K H KnX KnY KnM KnS T C D V Z
S
* *
*
D
*
Note: Please refer to specifications for more information about device
ranges.
Only the 32-bit instructions DFLT and DFLTP are valid.
16-bit instruction
- - - -
32-bit instruction (6 steps)
DFLT
Continuity
instruction
DFLTP
Pulse
instruction
Flags
Ox O100
M1808 M1968 Zero flag
M1809 M1969 Borrow flag
M1810 M1970 Carry flag
Please refer to the explanation below.
Explanation
The instruction is used to convert a binary integer into a binary floating-point
value.
S: Source device; D: Conversion result
1. If the absolute value of the converesion result is greater than the
maximum floating-point
value avaliable, a carry flag will be ON.
2. If absolute value of the conversion result is less than the mimum
floating-point vlaue available, a borrow flag will be ON.
3. If the conversion result is 0, a zero flag will be ON.
Example 1
When X11 is ON, the binary integer in (D1, D0) is converted into a binary
floating-point value, and the conversion result is stored in (D21, D20).
Suppose the value in the 32-bit register (D1, D0) is K100,000. When X11 is
ON, K100,000 is converted into the 32-bit floating-point value H4735000, and
H4735000 is stored in the 32-bit register (D21, D20).
X11
DFLT D0 D20
Example 2
Users can use applied instructions to perform the following calculation.
32
-bit binary
value
Two-digit
binary-coded
decimal value
Binary
floating-point
value
(D11,D10) (X7~X0)
K61.5
1
2
5
4
6
7
8
3
(D21,D20) Binary
floating-point value
(D201,D200)
(D101,D100)
(D301,D300)
(D31,D30)
Decimal floating-point value
(D41,D40)
32-bit integer
(D203,D202)
(D401,D400)
Binary
floating-point
value
Binary
floating-point
value
Binary
floating-point
value