456
DABIN, DABINP, DDABIN, DDABINP
For example, if the ASCII code of -1234543210
H
is designated for the area starting from , the operation result would be
stored at +1 and in the following manner:
(2) The ASCII data designated by to +5 can be in the range of from -2147483648 to 2147483647.
Further, data stored at the upper bytes of +5 will be ignored.
(3) The sign "20
H
" will be stored if the BIN data is positive, and the sign "2D
H
" will be stored if it is negative.
(If other than "20
H
" and "2D
H
" is set, it will be processed as positive data.)
(4) ASCII code can be set for each position within the range from "30
H
" to "39
H
".
(5) If the ASCII code set for individual positions is "20
H
" or "00
H
," it will be processed as "30
H
".
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Program
E
xamp
l
e
(1) The following program converts the decimal, 5-digit ASCII data and sign set at D20 through D22 to BIN values, and
stores the result at D0.
[Ladder Mode]
[List Mode]
[Operation]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The ASCII codes specified in to +5 other than "30
H
" to "39
H
",
"20
H
", or "00
H
".
The ASCII data specified in to +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 exceeds the range of the corresponding
device.
––
––
––
––
S
D
D
+
1
2D
H
(
)
31
H
(1)
32
H
(2)
33
H
(3)
b15
b8b7
b0
+
2
3
4
H
(
4
)
35
H
(5)
3
4
H
(
4
)
33
H
(3)
+
3
32
H
(2)
31
H
(1)
30
H
(0)
+4
+
5
12 3
4
3 2 1 0
+
1
5
4
D
S
S
S
S
S
S
D
S
S
S
S
S
S
S
S
Step
I
nstruct
i
on
De
vi
ce
D21
2D
H
(
)
20
H
(space)
20
H
(space)
32
H
(2)
b15
b8b7
b0
D20
D0
B
IN v
a
l
ue
276
37
H
(7)
36
H
(6)
D22
-
276
(Regarded
as
-
00276)