Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 444

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

Advertisement

Processing details
• These instructions convert the decimal ASCII data in the device areas specified by (s) and later to 32-bit binary data, and
store the converted data in the device specified by (d).
• The setting method of the decimal ASCII data to be set in (s) depends on the status of SM705 (Number of conversion digits
selection).
*1
Status of SM705
OFF
ON
*1 For the firmware version of the CPU module supporting SM705, refer to the following.
 MELSEC iQ-R CPU Module User's Manual (Application)
A CPU module which does not support SM705 operates in the same way as SM705 is off even if it is turned on.
■Setting method of (s) for when SM705 (Number of conversion digits selection) is off
Set decimal ASCII data with the fixed number of digits in (s) to (s)+5.
b15
∙∙∙
(s)
ASCII 10
9
(s)+1
7
ASCII 10
(s)+2
ASCII 10
5
(s)+3
ASCII 10
3
(s)+4
ASCII 10
1
(s)+5
(1)
ASCII S: Sign data of ASCII code
0
ASCII 10
: Ones place of ASCII code
1
ASCII 10
: Tens place of ASCII code
2
ASCII 10
: Hundreds place of ASCII code
3
ASCII 10
: Thousands place of ASCII code
4
ASCII 10
: Ten-thousands place of ASCII code
5
ASCII 10
: Hundred-thousands place of ASCII code
6
ASCII 10
: Millions place of ASCII code
7
ASCII 10
: Ten-millions place of ASCII code
8
ASCII 10
: Hundred-millions place of ASCII code
9
ASCII 10
: Billions place of ASCII code
(1) Ignored.
(2) Upper 16 bits
(3) Lower 16 bits
• The ASCII data in the device specified by (s) to (s)+5 is within the range from -2147483648 to 2147483647 for the
DDABIN(P) instruction, and it is within the range from 0 to 4294967295 for the DDABIN(P)_U instruction. Any data stored in
the upper bytes in the device specified by (s)+5 and data in the device specified by (s)+6 and later are ignored.
• As sign data, set 20H if the ASCII data is positive, and set 2DH if the data is negative. (If a value other than 20H and 2DH
is set, the data will be processed as positive data.)
• A value from 30H to 39H can be set in each place of ASCII code.
• If a value 20H or 00H is set in each place of ASCII code, the value will be processed as 30H.
Ex.
"-1234543210" is set in (s) when the DDABIN(P) instruction is used
b15
∙∙∙
(s)
31H (1)
(s)+1
33H (3)
(s)+2
35H (5)
(s)+3
33H (3)
(s)+4
31H (1)
(s)+5
6 BASIC INSTRUCTIONS
442
6.6 Data Conversion Instructions
Setting method of (s)
Set (s) with a fixed number of digits (a sign + 10
digits in the numeric part).
Set (s) with a desired number of digits (maximum: a
sign + 10 digits in the numeric part).
b8
b7
∙∙∙
b0
ASCII S
ASCII 10
8
ASCII 10
6
4
ASCII 10
2
ASCII 10
0
ASCII 10
b8
b7
∙∙∙
b0
2DH (-)
32H (2)
34H (4)
34H (4)
32H (2)
30H (0)
Reference
Page 442 Setting method of (s) for when SM705 (Number of conversion
digits selection) is off
Page 443 Setting method of (s) for when SM705 (Number of conversion
digits selection) is on
(d)+1
b31
∙∙∙
b16 b15
(2)
BIN32
(d)+1
(d)
-
1 2 3 4
5 4
3 2 1 0
(d)
∙∙∙
b0
(3)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents