L9E_CNVFI: Floating Point to Integer Conversion
(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 L9E_CNVFI DFB converts a floating point value to an integer value.
Representation
Parameters
Input Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
ON = initiates floating point to integer conversion
Node
Node Type
Name
Data Type
Address Range
Meaning
Top
IN
VALUE1
ARRAY[1...2] OF UINT
%MW
floating point value to be converted
VALUE1 stores the floating point value to be converted.
Middle
IN/OUT
RESULT
ARRAY[1...4] OF UINT
%MW
integer value
The integer result of the conversion is posted in word 3 and 4.
This value should be the largest integer value possible that is ≤ the floating point value. For example, the floating point value 3.5 is converted to the integer value 3, while the floating point value -3.5 is converted to the integer value -4.
Note: If the resultant integer is too large for 984 double precision integer format (> 99,999,999), the conversion still occurs but an event is logged in the L9E_ERLOG DFB.
Word 1 and 2 are not used but allocation is required.
Note: To preserve space, you can make the %MW reference numbers assigned to word 1 and 2 equal to VALUE1, since word 1 and 2 are not used.
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON = operation successful
(Event is flagged in the L9E_ERLOG DFB).
Middle
NEG
BOOL
OFF = positive integer value
ON = negative integer value