Mitsubishi Electric MELSEC-Q00U(J)CPU User Manual page 542

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
Application
Data A
Data B
Data C
Result
• Program before replacement
540
Before replacement
Device
Data type
D0 to D1
D2 to D3
Floating-point data
(single precision)
D4 to D5
D6 to D7
After replacement
Application
Device
Data A
D0 to D1
Data B
D2 to D3
Data C
D4 to D5
Result
D6 to D7
Subroutine
D900 to D903
input data 1
Subroutine
D904 to D907
input data 2
Subroutine
D908 to D911
operation result
Data type
Floating-point data
(single precision)
Floating-point data
(double precision)

Advertisement

Table of Contents
loading

Table of Contents