Mitsubishi MELSEC-Q/L Programming Manual page 535

Table of Contents

Advertisement

Program Example
(1) The following program performs an exponent operation on the value set by the 2 BCD digits at X20 to X31, and stores
the results as a 64-bit floating decimal point real number at D0 to D3.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operations involved when value designated by X20 to X31 is 13]
Conversion
1
X31
X20
to BIN
0
1 3
BCD value
BIN
*1:
The operation result will be under 2
1024
loge 2
= 709.7832.
Because setting a value of over 710 will return an operation error, turn M0 ON if a value of over 710 has been set to avoid the
error.
Conversion from natural logarithm to common logarithm
In the CPU module, calculation is made using a natural logarithm.
To obtain a common logarithm value, enter in,
Inputs data used for exponent
operation (
Checks the range of the value used
for operation. *1
Converts the input data into a 64-bit
floating-point real number (
Executes exponent operation (
Device
2
Conversion to
D20
D13 D12
b15
b0
floating-point
13
BIN value
FLTD
64-bit floating-point
real number
1024
if the BCD value of X20 to X31 is less than 709, from the calculation
S
).
1
).
2
).
3
D11
D10
3
EXP operation
13
EXPD
a common logarithm value divided by 0.43429.
EXPD, EXPDP
D3 D2
D1
D0
442413.4
64-bit floating-point
real number
533
1
2
3
4
4
6
7
8

Advertisement

Table of Contents
loading

Table of Contents