Mitsubishi Electric MELSEC FX3U Programming Manual page 533

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
Program example
In the program example shown below, the exponential operation is executed for a value set in the 2-digit BCD
format in X020 to X027, and the operation result is stored in the binary floating point format to D0 and D1
when X000 turns ON.
X000
FNC224
LD >
M0
Operation when "13" is specified in X020 to X027
[1]
Conversion
X027 X020
into binary
1 3
BCD value
BIN
Points
1) The operation result becomes less than "2
because of "loge2
If a value "89" or more is set, an operation error occurs. To prevent this operation error, when a value
more than "89" is set, M0 is set to ON so that the exponential operation is not executed.
2) Conversion from natural logarithm into common logarithm
In the CPU, operations are executed in natural logarithm.
For obtaining a value in common logarithm, specify a common logarithm value divided by "0.4342945" in
[
+1,
S
S
e
0.4342945
10
X
=
FNC 19
K2X20
BIN
D20
K88
FNC 49
D20
FLT
FNC124
D10
DEXP
[2] Conversion into
D20
binary floating point
b15
b0
(real number)
13
FLT
Binary value
128
= 88.7".
].
X
18 Floating Point – FNC110 to FNC139
18.12 FNC124 – EXP / Floating Point Exponent
D20
Data used in the exponential operation is input ([1]).
The range of the value to be operated is checked.
M0
(Refer to 1) in "Points" below.)
The input data is converted into binary floating point
D10
(real number) ([2]).
D0
The exponential operation is executed ([3]).
END
D11
D10
13
Binary floating point
(real number) value
128
" when the BCD value set in X020 to X027 is "88" or less
[3]
Exponential
D1
operation
442413.4
Binary floating point
EXP
(real number) value
11
12
13
14
D0
15
16
17
18
19
20
531

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents