Using Fixed-Point Data Types with Integer Based IP in LabVIEW FPGA 8.5.x Primary Software: Driver Software>>NI-RIOPrimary Software Version: 2.4 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: How can I use fixed-point data with LabVIEW FPGA Math and Analysis functions that only support integer data? Solution: As of LabVIEW 8.5.x, the LabVIEW FPGA Math and Analysis functions only support integer data types. If a fixed-point number is passed directly a function, the fractional portion will be truncated when the number is coerced to an integer. In order to use fixed-point data with integer IP you must sign extend the fixed-point data by increasing the integer word length to the size of the integer used. The steps below detail the method to pass a fixed-point number as an integer to the DC and RMS Measurements Express VI, which uses an I16 data type. Note, to ensure the Number to Boolean Array uses arrays of fixed dimensions you must select VI Properties, select Execution and check the Autopreallocate arrays and strings checkbox. Fixed-Point to Integer Conversion
Integer to Fixed-Point Conversion
An example for using PID, DC/RMS, and Sinewave generation is attached below. Related Links: KnowledgeBase 4DPGKPKO: How Can I Transfer My Fixed-Point Data Using a FIFO or Memory in LabVIEW 8.5.x? KnowledgeBase 4FSHBMLX: Using Fixed-Point Data with CompactRIO and LabVIEW FPGA Attachments:
Report Date: 03/17/2008 Last Updated: 05/16/2008 Document ID: 4JGA2HLX |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
