239
INT, INTP, DINT, DINTP
1
2
3
4
6
7
8
6.3
D
ata conversio
n instru
ctions
6.3.5
INT,
INTP, DI
NT, DI
NTP
DINT
(1) Converts 32-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 32-bit floating decimal point type real numbers that can be designated at +1 or is from -2147483648 to
2147483647.
(3) The integer value stored at +1 and is stored as BIN 32 bits.
(4) After conversion, the first digit after the decimal point of the real number is rounded off.
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 32-bit floating decimal point type real number at D20 and D21 to BIN 16-bit data, and
stores the result at D0.
[Ladder Mode]
[List Mode]
[Operation]
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
-126
| Specified device value | < 2
128
The specified device value is 0, unnormalized number, nonnumeric,
and ±
.
––
––
––
––
4100
The 32-bit floating point data specified by when the INT instruction is
used is outside the
-
32768 to 32767 range.
4100
The 32-bit floating point data specified by when the DINT instruction
is used is outside the -2147483648 to 2147483647 range.
S
D
B
IN
32
b
i
ts
L
ower
16
b
i
ts
U
pper
16
b
i
ts
32
-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
+
1
S
+
1
D
S
D
S
S
D
D
S
S
Step
Instruction
Device
I
nteger
convers
i
on
B
IN
va
l
ue
D0
25916
I
nteger
convers
i
on
An
operat
i
on
error
occurs
s
i
nce
"
sett
i
ng
data
< -
32768
."
32
-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
D21
-
33562
.
3211
D20
32
-
b
i
t
f
l
oat
i
ng
-
po
i
nt
rea
l
number
D21
25915
.
6796
D20