Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 441

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 specified by (s) and later to 16-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
Setting method of (s)
OFF
Set (s) with a fixed number of digits (a sign + 5 digits in
the numeric part).
ON
Set (s) with a desired number of digits (maximum: a
sign + 5 digits in the numeric part).
*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)+2.
b15
∙∙∙
b8
b7
(s)
4
ASCII 10
(s)+1
ASCII 10
2
(s)+2
0
ASCII 10
ASCII S: Sign data of ASCII code
4
ASCII 10
: Ten-thousands place of ASCII code
3
ASCII 10
: Thousands place of ASCII code
2
ASCII 10
: Hundreds place of ASCII code
1
ASCII 10
: Tens place of ASCII code
0
ASCII 10
: Ones place of ASCII code
• The ASCII data in the device specified by (s) to (s)+2 is within the range from -32768 to 32767 for the DABIN(P) instruction,
and it is within the range from 0 to 65535 for the DABIN(P)_U instruction.
• The data of (s)+3 or later is ignored.
• As sign data, set 20H (space) when the ASCII data is positive, and set 2DH (-) when 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.
"-25108" is set in (s) when the DABIN(P) instruction is used
b15
∙∙∙
b8
b7
(s)
32H (2)
(s)+1
31H (1)
(s)+2
38H (8)
∙∙∙
b0
ASCII S
b15
(d)
ASCII 10
3
1
ASCII 10
∙∙∙
b0
2DH (-)
b15
35H (5)
(d)
-
30H (0)
Reference
Page 439 Setting method of (s) for when SM705 (Number of
conversion digits selection) is off
Page 440 Setting method of (s) for when SM705 (Number of
conversion digits selection) is on
∙∙∙
b0
BIN16
∙∙∙
b0
2
5
1
0
8
6 BASIC INSTRUCTIONS
6.6 Data Conversion Instructions
6
439

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents