Mitsubishi Electric melsec q00ujcpu User Manual page 590

Programmable controller
Hide thumbs Also See for melsec q00ujcpu:
Table of Contents

Advertisement

(c) Replacing a part of floating-point operation instructions with double-precision floating-point
operation instructions using subroutine programs
The flow of a replacement program described in (b) can be regarded as one subroutine program.
Create a subroutine program for each floating-point operation instruction and then replace the original floating-
point operation instructions with the CALL(P) instruction so that the corresponding subroutine program is
called.
With this method, changes in the program are minimized, but the processing for calling subroutine programs
increases the scan time.
In addition, since conversions from double precision to single precision are performed for each instruction,
rounding-off errors generated during operations are larger than those in the replacement program described in
(b).
Example
Replacing the floating-point operation[A
1)
Device assignment
Before replacement
Application
Device
Data A
D0 to D1
Data B
D2 to D3
Data C
D4 to D5
Result
D6 to D7
2)
Program before replacemen
TableApp.38 Device assignment
Data type
Application
Data A
Data B
Floating-point data
(single precision)
Data C
Result
Subroutine input
data 1
Subroutine input
data 2
Subroutine
operation result
nt
Figure App.24 Sample program
B+C] (Using a subroutine program)
After replacement
Device
Data type
D0 to D1
D2 to D3
Floating-point data
(single precision)
D4 to D5
D6 to D7
D900 to D903
Floating-point data
D904 to D907
(double precision)
D908 to D911
APPENDICES
1
2
3
APPEN-
DIX
6
7
8
App - 46

Advertisement

Table of Contents
loading

Table of Contents