466
6 BASIC INSTRUCTIONS
6.6 Data Conversion Instructions
Processing details
• These instructions convert the single-precision real number data stored in the device specified by (s1) to the BCD floating
point format based on the number of decimal part digits stored in the device specified by (s2), and store the converted data
in the device number specified by (d) and later.
• For the sign in (d) and the exponent sign in (d)+3, 0 is set for positive and 1 is set for negative.
• For the BCD exponent in (d)+4, a value between 0 and 38 is stored.
• The number of decimal part digits of the single-precision real number data in the device specified by (s1) is stored in the
device specified by (S2). The example in the above figure shows the following.
• Six-digit BCD data, determined by rounding off the seventh digit, is stored in (d)+1 and (d)+2.
• A value of 0 to 7 can be set for the number of decimal part digits in the device specified by (s2).
• When an input value is set using the engineering tool, a rounding error may occur. Refer to the following for the precautions
on setting input values using the engineering tool.
Operation error
Error code
(SD0)
Description
3401H
The number of decimal part digits in the device specified by (s2) is out of the range from 0 to 7.
3402H
The value set to a device or label in (s1) is -0, a subnormal number, NaN (not a number), or
.
0
4270H
0325H
1
3
(s1)+1
(s1)
(s1)+1
(s1)
(s2)
27
3.254
3
3254270H
(d)
(d)+1
(d)+2
(d)+3
(d)+4
(d)
(d)+1
(d)+2
(d)+3
(d)+4
(s2)
Single-precision real number
Number of digits
in the decimal part
Sign
BCD (7 digits)
Sign of exponent
BCD exponent
Single-precision real number
BCD floating-point format
3.25427
(s2)=3
(s1)+1
(s1)
(s2)
3
(d)
(d)+1
(d)+2
(d)+3
(d)+4
.
1 2 3 4 5 6 7 8 9
0
1234570H
1
3
1234570
123456789
Rounded off.
Summary of Contents for MELSEC iQ-R Series
Page 1: ...MELSEC iQ R Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 24: ...22 INDEX 2092 INSTRUCTION INDEX 2093 REVISIONS 2104 WARRANTY 2105 TRADEMARKS 2106 ...
Page 34: ...32 MEMO ...
Page 35: ...33 PART 1 PART 1 OVERVIEW This part consists of the following chapter 1 OVERVIEW ...
Page 68: ...66 1 OVERVIEW 1 5 Precautions on Programming MEMO ...
Page 1448: ...1446 14 REDUNDANT SYSTEM INSTRUCTIONS 14 2 Disabling Enabling System Switching MEMO ...
Page 1972: ...1970 33 TIME DATA TYPE FUNCTIONS 33 4 Division MEMO ...
Page 2067: ...APPX Appendix 5 PID Control Program Examples 2065 A 252 Set PID control data for loop 2 ...
Page 2109: ......