Example Code

How do I convert to fixed-point to use the Fixed-Point Math FPGA VI's?

Code and Documents

Attachment

To convert to fixed-point, use the "To Fixed-Point" node in the numeric conversion palette. The context help and detailed help have more information about setting up the node. Just know that if you don't wire anything into the top of it, it will automatically choose a representation. If you need to have a specific representation to eliminate data coersion issues and know exactly what data you're sending that VI, then you'll want to wire in a constant to the top, right-click it, and edit its properties.

Another option, of course, is just to do all of your math with regular multipliers, adders, etc., and then allow LabVIEW to automatically coerce the data at the input terminal to the function.

Convert to FXP FPGA example LV 860.png

Dan Richards
Certified LabVIEW Developer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors