474
18 Applied Instructions (Floating Point)
18.13 DLOGE / Floating Point Natural Logarithm
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Error
In the following cases, it is an operation error, error flag (M8067) is turned ON, and error code is stored in
D8067.
• When the value specified by is negative. (Error code: K6706)
• When the value specified by is 0. (Error code: K6706)
Program example
This is a program for determining the natural logarithm of "10" set in D50 when the X000 is turned ON, and
storing in D30, D31.
[Structured ladder/FBD]
X000
D40
MOV
EN
s
ENO
K10 D50
DLOGE
EN
s
ENO
d
d
D30
[ST]
MOV(X000,K10,D50);
FLT(X000,D50,D40);
DLOGE(X000,D40,D30);
FLT
EN
s
ENO
d
D40
D50
Setting of data for natural logarithm operation.(1))
Conversion of operation data into binary floating
decimal point (real number).(2))
Operation of natural logarithm.(3))
Value of binary floating
decimal point (real number)
10
10
1)
MOV
10
b15 b0
2) Conversion of binary
floating decimal point
(real number)
3) LOG
operation
LOGE
D41 D40
Value of binary floating
decimal point (real number)
2.302585
D31 D30
FLT
D50
BIN value