Mitsubishi MELSEC-Q/L Programming Manual page 537

Table of Contents

Advertisement

Program Example
(1) The following program seeks the natural logarithm of the value "10" set by D50, and stores the result at D30 and D31.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operation]
D50
b15
1
10
10
MOV
BIN value
7.12.24 LOGD, LOGDP
Natural logarithm operation on floating-point data
(Double precision)
7.12.24
LOGD, LOGDP
LOGD
LOGDP
: Data of which the natural logarithm is obtained or head number of the devices where the data is stored (real number)
S
: Head number of the devices where the operation result will be stored (real number)
D
Internal Devices
Setting
Data
Bit
Word
––
S
––
D
Function
(1) Returns the natural logarithm of the value designated by
designated by
.
D
S
+3
S
+2
S
+1
log
(
64-bit floating-point
real number
(2) Only positive values can be designated by
(3) When the operation results in -0 or an underflow, the result is processed as 0.
Sets data used for natural
logarithm operation (
Converts the operation data
into a 32-bit floating-point real number (
Executes natural logarithm operation (
Device
Conversion to
D41
b0
2
floating-point
1 0
FLT
32-bit floating-point
real number
Command
Command
J
\
R, ZR
Bit
S
D
+3
D
)
(
64-bit floating-point
real number
. (Operation cannot be performed on negative numbers.)
S
)
1
D40
D31
LOG operation
3
2 . 3 0 2 5 8 5
LOG
32-bit floating-point
real number
High
Basic
performance
LOGD
LOGDP
U
\G
Word
––
––
taking (e) as base, and stores operation results at device
S
+2
D
+1
D
)
LOGD, LOGDP
)
2
)
3
D30
Process
LCPU
Redundant
Universal
S
D
S
D
Constants
Zn
Other
E
––
1
2
3
4
4
6
7
8
––
––
535

Advertisement

Table of Contents
loading

Table of Contents