Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 662

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Processing details
• These instructions add a decimal point to the 16-bit binary data in the device specified by (s2) at the location specified by
(s1), convert the data to character string data, and store the converted data in the device areas specified by (d) and later.
(s1)
Total number of digits
Number of digits in the
(s1)+1
decimal part
16-bit binary data
(s2)
Ex.
When converting data "-123" in (s2) into a string assuming that the number of decimal places is one ("-12.3")
-
1
2
.
3
b15
(d)
(d)+1
(d)+2
• The total number of digits that can be specified by (s1) is 2 to 8.
• The number of digits in the decimal part that can be specified by (s1)+1 is 0 to 5. Note that the number of digits in the
decimal part must be smaller than the total number of digits minus 3.
7 APPLICATION INSTRUCTIONS
660
7.8 String Processing Instructions
.
Sign
(s1)
5
(s1)+1
1
(s2)
-123
∙∙∙
b8
b7
∙∙∙
b0
31H (1)
2DH (-)
2EH (.)
32H (2)
00H
33H (3)
b15
b8 b7
∙∙∙
ASCII code ((total number of
(d)
digits - 1)th digit)
ASCII code ((total number of
(d)+1
digits - 3)th digit)
ASCII code ((total number of
(d)+2
digits - 5)th digit)
ASCII code ((total number of
(d)+3
digits - 7)th digit)
00H
(d)+4
A null character, 00H, is automatically stored at the end of string.
b0
∙∙∙
ASCII code (sign data)
ASCII code ((total number of
digits - 2)th digit)
Device area for the total
ASCII code ((total number of
number of digits
digits - 4)th digit)
ASCII code ((total number of
digits - 6)th digit)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents