Mitsubishi Electric M800VW Series Programming Manual page 420

Plc programming
Hide thumbs Also See for M800VW Series:
Table of Contents

Advertisement

M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.11 Special Function Instructions
 Program example
 The following program conducts an exponent operation on the value set as BCD 2-digit from X20 to X31 and stores the
operation result at D0 to D3 as a 64-bit floating-point real number.
X0
0
4
> D20 K709
M0
8
15
64-bit floating-point real
number
(*1) The operation result will be less than 2
Because setting a value of 710 or more will return an arithmetic error, M0 is turned ON to stop the operation if a value of
710 or more has been set so as to avoid the error.
POINT
Conversion from natural logarithm to common logarithm
In the CPU, calculations are made using a natural logarithm.
When seeking the common logarithm value, designate the common logarithm value divided by 0.43429 to (S).
[Ladder mode]
Inputs the data used for
BIN K3X20 D20
exponent operation (1).
Checks the range of the
M0
value for operation.(*1)
Converts the input data into
FLTD D20 D10
a 64-bit floating-point real
number (2).
EXPD D10 D0
Executes exponent
operation (3).
END
[Operations when X20 to X31 designate a value of 13]
(1)Conversion to BIN
X31
X20
0 1 3
BIN
BCD value
(3)EXP
operation
D13
D12
D11
D10
13
1024
if the BCD value of X20 to X31 is 709 or less, as log
D20
b15
b0
13
BIN value
(2)Conversion to floating-point
real number
FLTD
D3
D2
D1
D0
442413.4
EXPD
64-bit floating-point real
number
399
[List mode]
Steps
Inst.
Device
0
LD
X0
1
BIN
K3X20
D20
4
LD>
D20
*
K709
7
OUT
M0
8
OR
M0
9
FLTD
D20
D10
12
EXPD
D10
D0
15
END
1024
2
= 709.7832.
e
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents