Mitsubishi Electric MELSEC-Q/L Programming Manual page 540

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

■DDABIN
• Converts decimal ASCII data stored into the area starting from the device number designated by (S) into BIN 32-bit data,
and stores it in the device number designated by (D).
b15
S
ASCII code for billions place
S
+1
ASCII code for ten-millions place
S
+2
ASCII code for hundred-thousands place
S
+3
ASCII code for thousands place
S
+4
ASCII code for tens place
S
+5
(Ignored)
For example, if the ASCII code of -1234543210H is designated for the area starting from (S), the operation result would be
stored at (D)+1 and (D) in the following manner:
b15
S
31
(1)
H
S
+1
33
(3)
H
S
+2
35
(5)
H
S
+3
33
(3)
H
S
+4
31
(1)
H
S
+5
• The ASCII data designated by (S) to (S)+5 can be in the range of from -2147483648 to 2147483647. Further, data stored at
the upper bytes of (S)+5 will be ignored.
• The sign "20H" will be stored if the BIN data is positive, and the sign "2DH" will be stored if it is negative. (If other than "20H
" and "2DH" is set, it will be processed as positive data.)
• ASCII code can be set for each position within the range from "30H" to "39H".
• If the ASCII code set for individual positions is "20H" or "00H," it will be processed as "30H".
Operation error
• In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into SD0.
Error
Error details
code
4100
The ASCII codes specified in (S) to (S) +5 other than "30H" to "39H", "20H",
or "00H".
The ASCII data specified in (S) to (S) +5 is outside the following ranges:
• When the DABIN instruction is used: -32768 to 32767
• When the DDABIN instruction is used: -2147483648 to 2147483647
4101
The device specified in (S) exceeds the range of the corresponding device.
7 APPLICATION INSTRUCTIONS
538
7.11 Character String Processing Instructions
b8b7
b0
Sign data
ASCII code for hundred-millions place
ASCII code for millions place
ASCII code for ten-thousands place
ASCII code for hundreds place
ASCII code for units place
b8b7
b0
2D
( )
H
32
(2)
H
34
(4)
H
34
(4)
H
32
(2)
H
30
(0)
H
D
+1
b31
b16b15
Upper 16 bits
Lower 16 bits
BIN 32 bits
D
+1
D
12 34
5 4
3 2 1 0
Q00J/
Q00/
Q01
D
b0
QnH
QnPH
QnPRH
QnU
LCPU

Advertisement

Table of Contents
loading

Table of Contents