5
Categories and Use of Basic Application Instructions
DVP-PM Application Manual
5-105
API Mnemonic
Operands
Function
126
D LOG P
Float Logarithm Operation
Controllers
20PM
10PM
Bit Devices
Word Devices
Program Steps
Type
OP
X Y M S F H
KnX KnY KnM KnS T
C
D
V
Z
S
1
*
*
S
2
*
*
D
*
DLOG, DLOGP: 9 steps
Operands:
S
1
: Base
S
2
: Antilogarithm
D
: Operation result
Explanations:
1. Perform logarithm operation with
S
1
as the base and
S
2
as the antilogarithm and save the result in
D
.
2. F refers to floating point input. Be sure to add a decimal point when using it.
3. Only 32-bit instructions DLOG and DLOGP are applicable.
4. Only a positive number is valid for
S
. Register
D
has to be 32-bit format. Operation is conducted in floating point
value, so the value in
S
needs to be converted into floating value before logarithm operation.
5. Logarithm
operation:
S
1
D
= S
2
,
D =
?
Æ
Log
S1
S2
= D
Example: Assume
S
1
= 5,
S
2
= 125,
D
= log
5
125
= ?
S
1
D
=
S
2
Æ
5
D
= 125
Æ
D
= log
5
125
= 3
6. Flags:
OX
O100
Zero flag
M1808
M1968
Borrow flag
M1809
M1969
Carry flag
M1810
M1970
a) If the absolute value of the result exceeds the max floating point value, carry flag will be ON.
b) If the absolute value of the result is less than min. floating point value, borrow flag will be ON.
c) If the conversion result is 0, zero flag will be ON.
Program Example:
1. When M0 = ON, convert (D1, D0) and (D3, D2) to binary floating value and save the result in register (D11, D10)
and (D13, D12) individually.
2. When M1= ON, perform natural logarithm operation with (D11, D10) as base and (D13, D12) as antilogarithm.
The value is saved in register (D21, D20) in binary floating format.
3. When M2 = ON, convert the value in (D21, D20) into decimal floating point value and save the result in (D31,
D30). (At this time, D31 indicates powers of 10 for D30).
M0
DFLT
D0
D10
M1
DLOG
D10
D12
M2
DEBCD
D20
D30
DFLT
D2
D12
D20
Points to note:
For floating point operations, see “5.3 Numeric Values for Data Processing”
Summary of Contents for DVP-10PM
Page 1: ......
Page 45: ...2 Hardware Specifications and Wiring DVP PM Application Manual 2 30 MEMO...
Page 125: ...3 Functions of Devices in DVP PM DVP PM Application Manual 3 80 MEMO...
Page 341: ...8 Application Examples DVP PM Application Manual 8 2 Trajectory 3 Trajectory 4...
Page 427: ...9 Electrical CAM DVP PM Application Manual 9 74...
Page 437: ...10 Encrypting User Program DVP PM Application Manual 10 10 MEMO...
Page 458: ...11 G code Application DVP PM Application Manual 11 21 B O100 main program...
Page 561: ...14 Appendix DVP PM Application Manual 14 4 MEMO...