L9_FTOI: Floating Point to Integer
(Original Document)
Naming
Name in LL984 Editor
Function Block Name
name of legacy 984 instruction
name in other tools and editors like:
  • Type Library Browser
  • Data Editor
  • Animation Tables
  • Search Results
Function Description
The FTOI procedure performs the conversion of a floating value to a signed or unsigned integer (stored in two contiguous words), then stores the converted integer value in DEST.
FTOI has two control inputs. ENABLE initiates the operation when it is ON. The state of the SIGNED indicates whether the conversion will be a signed or unsigned operation.
FTOI produces 2 possible outputs. OUT goes ON upon successful completion of the conversion. If ERR passes power, the value of the converted integer value is out of range.
NOTE: In legacy LL984 applications the ERR output did not work in the intended way.
Representation
Parameters
Input Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
ON = enables conversion
Bottom
SIGNED
BOOL
ON = signed operation
OFF = unsigned operation
Node
Node Type
Name
Data Type
Address Range
Meaning
Top
IN
SOURCE
ArrUInt2
%MW
Source parameter where the numerical value to be converted is stored in two UINT words to be declared as ARRAY[1..2] OF UINT. The lower part in SOURCE[1] and the higher part in SOURCE[2].
Middle
IN/OUT
DEST
UINT
%MW
destination parameter where the converted numerical value is posted
Bottom
IN
CONST
UINT
1
constant value of 1, can not be changed
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON = integer conversion completed successfully
Bottom
ERR
BOOL
ON = converted integer value is out of range