3 . I n s t r u c t i o n S e t
M N 0 5 0 0 3 0 0 3 E 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
3 - 3 0 9
API Mnemonic
Operands
Function
126
D LOG P
S
1
, S
2
, D
Floating Point 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
1
*
*
*
S
2
*
*
*
D
*
DLOG, DLOGP: 13 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
1
: operand base address
S
2
: operand source address
D
: operand result address
Description:
1.
Perform logarithm operation to
S
1
and
S
2
and save the result to
D
. LOG base
S
1
of
S
2
=
D.
2.
Only positive numbers are valid for
S
2
(positive and negative numbers are valid for
S
1
).
Operand D is a 32-bit floating point value. Therefore,
S
1
and
S
2
need to be converted to
floating point.
3.
Flag: 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) and (D2, D3) to binary floating point and save the result in
register (D10, D11) and (D12, D13). (D10,D11) is the base of the log and (D12,D13) is the
value we are taking the log of.
2.
When M1= ON, use (D10, D11) and (D12, D13) binary floating point of 32-bit registers to
perform logarithm operation and save the result in 32-bit register (D20, D21).
3.
When M2= ON, convert (D20, D21) binary floating point of 32-bit registers to decimal floating
point and save the result in register (D30, D31).
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...