Example Code

R-Series IO Conversion

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW FPGA Module
  • LabVIEW

Code and Documents

Attachment

Description

Overview

The example demonstrates how to convert a R-Series I/O raw value to a fixed point value.

 

Description

There are two analog I/O data types available for use, depending on your FPGA target. If you use a PCI/PCIe/PXI/PXIe R Series target, the analog I/O data type is either an I16 or an I32, depending on the device. These devices return uncalibrated data. If you use a CompactRIO target or USB R Series target, then the default data type is fixed-point and the data has been calibrated. You can, however, choose to configure the module to return raw integer data as well.

If the FPGA device does not support calibrated data (fixed-point representation) the uncalibrated data has to be often converted from an integer to a fixed-point representation e.g. to perform analysis operations. In control application with little allowed latency that conversion has to be performed on the FPGA. The example demonstrates how to do the conversation from uncalibrated integer data to fixed-point data.

 

Requirements

 Software

  • LabVIEW 2012 Base Development System (or compatible)
  • LabVIEW 2012 FPGA Module (or compatible)

 Hardware

  • No hardware is necessary to use this example VI (in simulation mode)

 

Steps to Implement or Execute Code

  1. Open the attached file
  2. Run the VI

 

Additional Information or References

R-Series IO Raw Value to Fixed-Point Conversion - Front Panel.png

 

R-Series IO Raw Value to Fixed-Point Conversion - Block Diagram.png

Working With Calibrated and Uncalibrated Data on NI R Series

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Ryan K.
Product Manager, ATCA and BEEcube
National Instruments

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