Floating-Point Value Conversion 64-Bit Into 32-Bit: Sflt - Mitsubishi Electric R16MTCPU Programming Manual

Hide thumbs Also See for R16MTCPU:
Table of Contents

Advertisement

Floating-point value conversion 64-bit into 32-bit: SFLT

Format
SFLT(S)
Setting data
■Usable Data
: Usable
Setting
Usable Data
data
Bit
device
(S)
■Description, data type of result
Setting data
Description
(S)
Data which will be converted into 32-bit floating-point value
Processing details
• The 64-bit floating-point (double precision real number) value stored in the device specified with (S) is converted into the
32-bit floating-point (single precision real number) value. Convertible data ranges are shown below.
38
-3.40  10
to -1.18  10
• The 64-bit floating-point type is used as the data of floating-point type in the Motion SFC program. Use this instruction to
output the data into the external devices that cannot use the 64-bit floating-point type.
The number of effective digits of 32-bit floating-point value data is approx. 7 digits. Data in the seven digits or
later of conversion result by SFLT instruction may not match the (S) data.
Operation error
An operation error will occur if:
• The (S) data is not a valid 64-bit floating-point type.
• The (S) data after convert is outside the range of 32 bit floating-point type.
Program example
■Program which converts the 64-bit floating-point value data of #0F into 32-bit floating-point
value data and substitutes the result to D2000L
D2000L = SFLT(#0F)
D2001
D2000L
K-1.0
4 OPERATION CONTROL PROGRAMS
176
4.9 Type Conversions
Number of basic steps
4
Word device
16-bit
32-bit
64-bit
integer
integer
floating
type
type (L)
point
type (F)
-38
-38
, 0.0, 1.18  10
D2000
Usable steps
F/FS
Constant
16-bit
32-bit
64-bit
integer
integer
floating
type
type
point
(K/H)
(K/H, L)
type (K)
38
to 3.40  10
(single precision real number)
#3
#2
#1
#0F
K-1.0
G
Calculation
Bit
expression
conditional
expression
Data type of result
32-bit floating-point type
#0
Comparison
conditional
expression

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

R64mtcpuMelsec iq-r seriesR32mtcpu

Table of Contents