Mitsubishi Electric Q01UCPU User Manual page 535

Hide thumbs Also See for Q01UCPU:
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).
Replacing the floating-point operation[A × B + C] (Using a subroutine program)
Ex.
• 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
• Program before replacement
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
APPENDICES
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
A
533

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents