EasyManua.ls Logo

Mitsubishi Electric MELSEC-Q/L - Page 276

Mitsubishi Electric MELSEC-Q/L
1084 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
274
6 BASIC INSTRUCTIONS
6.3 Data Conversion Instructions
Due to the fact that 32-bit floating decimal point type real numbers are processed by simple 32-bit processing, the number
of significant digits is 24 bits if the display is binary and approximately 7 digits if the display is decimal. For this reason, if the
integer exceeds the range of -16777216 to 16777215 (24-bit BIN value), errors can be generated in the conversion value.
As for the conversion result, the 25th bit from the upper bit of the integer is always filled with 1 and 26th bit and later bits are
truncated.
Operation error
There is no operation error in the FLT(P) or DFLT(P) instruction.
Program example
The following program converts the BIN 16-bit data at D20 to a 32-bit floating decimal point type real number and stores the
result at D0 and D1.
The following program converts the BIN 32-bit data at D20 and D21 to a 32-bit floating decimal point type real number, and
stores the result at D0 and D1.
[Ladder Mode] [List Mode]
[Operation]
[Ladder Mode] [List Mode]
[Operation]
Integer
b31 b24 b23 b16
222030030
0 0 001 10100111 011
b15 b8
b7
b0
1 1 101 00011001 110
Result of operation
is 222030032.
Truncation
Always filled with 1
After conversion
372588919
0 0 010 11000110 101 0 1 000 00101110 111
Result of operation
is 372588928.
Truncation
Always filled with 1
b31 b24 b23 b16 b15 b8
b7
b0
Step
Instruction
Device
Integer
conversion
32-bit floating-point
real number
15923
D20
BIN value
D1
15923
D0
Step
Instruction
Device
D21
173963112
D20
D21
16543521
D20
D1
16543521
D0
D1
173963120
D0
Integer
conversion
Integer
conversion
An error is generated in operation results since
the number of significant digits is "7".
BIN value
BIN value 32-bit floating-point
real number
32-bit floating-point
real number

Table of Contents

Related product manuals