241
INTD, INTDP, DINTD, DINTDP
1
2
3
4
6
7
8
6.3
D
ata conversio
n instru
ctions
6.3.6
INTD
, INTD
P, DINT
D, DINT
DP
DINTD
(1) Converts 64-bit floating decimal point type real number designated by to BIN 32-bit data, and stores the result at the
device number designated by .
(2) The range of 64-bit floating decimal point type real numbers that can be designated at +3, +2, +1 or is from
-2147483648 to 2147483647.
(3) The integer value stored at +1 and is stored as BIN 32 bits.
(4) The converted data is the value rounded 64-bit floating-point real number to the first digit after the decimal point.
Operation Error
(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 Example
(1) The following program converts the 64-bit floating decimal point type real number at D20 to D23 with BIN 16-bit data, and
stores the result at D0.
[Ladder Mode]
[List Mode]
[Operation]
(2) The following program converts the 64-bit floating decimal point type real number at D20 to D23 with BIN 32-bit data and
stores the result at D0 and D1.
[Ladder Mode]
[List Mode]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4140
The specified device value is not within the following range:
0, 2
-1022
| Specified device value | < 2
1024
The specified device value is 0, unnormalized number, nonnumeric,
and ±
.
––
––
––
––
4100
The 64-bit floating point data specified by when the INTD instruction
is used is outside the
-
32768 to 32767 range.
––
––
––
––
4100
The 64-bit floating point data specified by when the DINTD
instruction is used is outside the -2147483648 to 2147483647 range.
––
––
––
––
S
D
B
IN
32
b
i
t
L
ower
16
b
i
ts
U
pper
16
b
i
ts
+
1
D
D
+
3
6
4-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
S
+
2
S
S
+
1
S
S
S
S
S
D
D
S
S
Step
Instruction
Device
Convers
i
on
to
i
nteger
B
IN
va
l
ue
D0
25916
Convers
i
on
to
i
nteger
An
operat
i
on
erroe
occurs
because
the
spec
i
f
i
ed
data
i
s
l
arger
than
-
32768
.
D21
25915
.
6796
D20
D23 D22
D21
33562
.
3211
D20
D23 D22
6
4-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
6
4-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
Step
Instruction
Device