E L C P r o g r a m m i n g M a n u a l
F o r m o r e i n f o r m a t i o n v i s i t :
w w w. e a t o n . c o m
M N 0 5 0 0 3 0 0 3 E
3 - 3 0 8
API Mnemonic
Operands
Function
125
D LN P
S, D
Floating Natural Logarithm Operation
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K
H KnX
KnY
KnM KnS T
C
D
E
F
S
*
*
*
D
*
DEXP, DEXPP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32
16
P
32
16
P
32
16
P
32
16
P
32 16
P
Operands:
S
: operand source address
D
: operand result address
Description:
1.
Perform natural logarithm operation to operand
S
:
LN[
S
+1,
S
]=[
D
+1,
D
]
2.
Only a positive number is valid for
S
. Operand D must use a 32-bit floating point value for this
instruction. Therefore,
S
needs to be converted to floating point.
3. e
D
=
S
and
D
=ln
S
.
4.
Flags: M1020 Zero flag, M1021 Borrow flag and M1022 Carry flag.
If the absolute value of the result is larger than the maximum allowable floating point value, the
carry flag M1022= ON.
If the absolute value of the result is less than the minimum allowable floating point value, the
borrow flag M1021= ON.
If the conversion result is 0, zero flag M1020= ON.
Program Example:
1.
When M0= ON, convert (D0, D1) to binary floating point and save the result in register (D10,
D11).
2.
When M1= ON, use (D10, D11) as a real number and perform natural logarithm operation. The
result is a binary floating point value saved in register (D20, D21).
3.
When M2= ON, convert (D20, D21) binary floating point to decimal floating point and save the
result in register (D30, D31).
M0
RST
M1081
M1
DLN
D10
D20
M2
DEBCD
D20
D30
DFLT
D0
D10
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...