EasyManua.ls Logo

Mitsubishi Electric melsec q03ud(E)cpu - Page 588

Mitsubishi Electric melsec q03ud(E)cpu
622 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1
2
3
APPEN-
DIX
6
7
8
Appendix 3 Method of Replacing Basic Model QCPU or High Performance Model QCPU with Universal
Model QCPU
Appendix 3.4 Functions
APPENDICES
App - 44
(b) Replacing a part of floating-point operation instructions with double-precision floating-point
operation instructions
Only operations that require high accuracy are replaced with double-precision floating-point opera-
tion instructions.
Using the ECON and EDCON instructions, convert floating-point data mutually between single pre-
cision and double-precision. The flow of a replacement program is as follows:
Data required for operations are converted from single precision to double precision using the ECON
instruction.
Operations are performed in double precision using the double-precision floating-point operation instruc-
tions.
Operation results are converted from double precision to single precision using the EDCON instruction.
A program example that floating-point data are converted mutually between single precision and
double precision before and after operations is shown below.
1) Device assignment
2) Program before replacement
Example
Replacing the floating-point operation [A B+C] (Using the ECON and EDCON
instructions)
TableApp.37 Device assignment
Before replacement After replacement
Application Device Data type Application Device Data type
Data A D0 to D1
Floating-point data
(single precision)
Data A D0 to D1
Floating-point data
(single precision)
Data B D2 to D3 Data B D2 to D3
Data C D4 to D5 Data C D4 to D5
Result D6 to D7 Result D6 to D7
Data A D10 to D13
Floating-point data
(double precision)
Data B D14 to D17
Data C D18 to D21
Result D22 to D25
Figure App.22 Sample program

Table of Contents

Related product manuals