Mitsubishi Electric M800VW Series Programming Manual page 418

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 X27 and stores the
operation result at D0 and D1 as a 32-bit floating-point real number.
X0
0
X1
4
8
> D20 K88
< D20 K-87
M1
15
22
X27
32-bit floating-point real
number
(*1) The operation result will be less than 2
Because setting a value of 89 or more will return an arithmetic error, M1 is turned ON to stop the operation if a value of
89 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).
* D20 K-1 D20
Checks the range of the
M1
value for operation.(*1)
Converts the input data into
a 32-bit floating-point real
FLT D20 D10
number (2).
EXP D10 D0
Executes exponent
operation (3).
END
[Operations when X20 to X27 designate a value of 13]
(1)Conversion to BIN
X20
1 3
BIN
BCD value
(3)EXP
operation
D11
D10
13
EXP
128
if the BCD value of X20 to X27 is 88 or less, as log
D20
b15
b0
13
BIN value
(2)Conversion to floating-point
real number
FLT
D1
D0
442413.4
32-bit floating-point real
number
397
[List mode]
Steps
Inst.
Device
0
LD
X0
1
BIN
K3X20
D20
4
LD
X1
5
*
D20
K-1
D20
8
LD>
D20
K88
11
OR<
D20
K-87
14
OUT
M1
15
OR
M1
16
FLT
D20
D10
19
EXP
D10
D0
22
END
128
2
= 88.7.
e
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents