296
6 BASIC INSTRUCTIONS
6.3 Data Conversion Instructions
Conversion from double precision to single precision
EDCON(P)
• Converts 64-bit floating-point real number specified for (S) into 32-bit floating-point real number, and stores the conversion
result to the device specified for (D).
• When an input value is set using a programming tool, a rounding error may occur. For precautions, refer to Page 89
Precautions.
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
• The program which converts 64-bit floating-point real number of the devices, D10 to D13, into 32-bit floating-point real
number when X0 turns ON, and outputs the conversion result to the devices, D0 to D1.
(S): Conversion source data, or head number of the device where conversion source data is stored (Real number (double precision))
(D): Head number of the device where the converted data is stored (Real number (single precision))
Setting
data
Internal device R, ZR J\ U\G Zn Constant
E
Others
Bit Word Bit Word
(S)
(D)
Error
code
Error details Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4140 The specified device value is not within the following range:
0, 2
-1022
| Specified device value | < 2
1024
The specified device value is -0, unnormalized number, nonnumeric, and .
4141 The conversion result exceeds the following range (when an overflow occurs):
|Operation result| < 2
128
[Ladder Mode] [List Mode]
Universal
LCPU
Basic
High
performance
Process
Redundant
EDCON
EDCONP
S
D
S D
EDCON
EDCONP
Command
Command
+1
D D
32-bit floating-point real number
+3
+2 +1
S
64-bit floating-point real number
S
S
S