5 Applied Instructions and Basic Usage
DVP-20PM Application Manual
5-105
API
Applicable model
20PM
125
D
D
LN
P
P
Natural logarithm of a binary
floating-point value
Bit device Word device
X Y M S F H KnX KnY KnM KnS T C D V Z
S
*
*
D
*
Note: Please refer to specifications for more information about device
ranges.
F represents a floating-point value. There is a decimal point in a
floating-point value.
Only the 32-bit instructions DLN and DLNP are valid.
16-bit instruction
- - - -
32-bit instruction (6 steps)
DLN
Continuity
instruction
DLNP
Pulse
instruction
Flags
Ox O100
M1808 M1968 Zero flag
M1809 M1969 Borrow flag
M1810 M1970 Carry flag
M1793 M1953 Operation error flag
Please refer to the additional remark below.
Explanation
The natural logarithm of the value in S is calculat
ed.
S: Source device; D: Device in which an operation result is stored
Ln[S+1, S]=[D+1, D]
The value in S can only be a positive value. D must be a 32-bit register, and
the value in S must be a floating-point value.
If the value in S is not a positive value, an operation error will occur, the
instruciton will not be executed, an operation error flag will be ON, and the
error code H0E19 will appear.
e
D
=S.→The value in D=lnS (S: Source device)
If the absolute value of an oepration result is greater than the maximum
floating-point value available, a carry flag will be ON.
If the absolute value of an oepration reuslt is less than the minimum
floating-point value available, a borrow flag will be ON.
If an operation result is 0, a zero flag will be ON.
Example
When M0 is ON, the value in (D1, D0) is converted into a binary floating-point
value, and the conversion result is stored in (D11, D10).
When M1 is ON, the natural logarithm of the floating-point value in (D11, D10)
is calculated, and the operation result is stored in (D21, D20).
When M2 is ON, the binary floating-point value in (D21, D20) is converted into
a decimal floating-point value, and the conversion result is stored in (D31,
D30). (The value in D31 is the value in D30 to the power of 10.)
M0
DFLT D0 D10
M1
DLN D10 D20
M2
DEBCD D20 D30
Additional
remark
Please refer to section 5.3 for more information about performing operations
on floating-point values.