Справочник Пользователя для Mitsubishi Electronics FX

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-124
5.11.10 INT (FNC 129)
Operation:
The floating point value of S is rounded down to
the nearest integer value and stored in normal
binary format in D.
Points to note:
a) The source data is always a double (32 bit) word; a floating point value. 
For single word (16 bit) operation the destination is a 16 bit value.
For double word (32 bit) operation the destination is a 32 bit value.
b) This instruction is the inverse of the FLT instruction. (See page 5-49)
c) If the result is 0 then the zero flag M8020 is set ON.
If the source data is not a whole number it must be rounded down. In this case the borrow
flag M8021 is set ON to indicate a rounded value.
If the resulting integer value is outside the valid range for the destination device then an
overflow occurs. In this case the carry flag M8022 is set on to indicate overflow.
Note: If overflow occurs, the value in the destination device will not be valid.
Mnemonic
Function 
Operands
Program steps
S
D
INT
FNC 129
(Float to
Integer)
Converts a
number from
floating point
format to decimal
format
D - must be in floating
point number format
(always 32 bits).
D - decimal format
for INT, INTP - 16 bits
for DINT, DINTP - 32 
bits
INT, INTP:
5 steps
DINT, DINTP:
9 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
FLAGS
Zero M8020
Borrow M8021
Carry M8022
DINT
M25
D510 D254