Mitsubishi Electronics FX3G Benutzerhandbuch

Seite von 964
512
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
Programming Manual - Basic & Applied Instruction Edition
18 Floating Point – FNC110 to FNC139
18.13 FNC125 – LOGE / Floating Point Natural Logarithm
Program example
In the program example shown below, natural logarithm of "10" set in D50 is calculated, and stored to D30 and D31
when X000 turns ON.
X000
FNC 49
FLT
D50
Data used in the natural logarithm operation is set
([1]).
The data to be used is converted into binary floating
point (real number) ([2]).
The natural logarithm operation is executed ([3]).
D40
FNC 12
MOV
K10
D50
FNC125
DLOGE
D40
D30
END
Binary floating point
(real number) value
10
10
[1]
MOV
10
b15
b0
[2] Conversion into
binary floating point
(real number)
[3] Logarithm
operation
LOGE
D41
D40
Binary floating point
(real number) value
2.302585
D31
D30
FLT
D50
Binary value