Introduction to the FPGA Interface C API


The FPGA Interface C API is a C API for communication between processor and FPGA within NI reconfigurable I/O (RIO) hardware such as NI CompactRIO, NI Single-Board RIO, NI Ethernet RIO, NI FlexRIO, NI R Series multifunction RIO, and NI MXI-Express RIO for embedded control and acquisition applications.

With the FPGA Interface C API, developers can use LabVIEW graphical tools to program the field-programmable gate array (FPGA) within NI hardware and choose either LabVIEW or C/C++ tools to program the processor within the system. This gives engineers and scientists with C expertise the ability to take advantage of FPGAs within their designs without the burden of learning hardware design while also giving them the option to reuse their existing embedded C code.


FPGA Interface C API

With the FPGA Interface C API, engineers and scientists can program the real-time processor on NI FPGA-based hardware using C tools such as NI LabWindows/CVI, Microsoft Visual Studio, Eclipse, Wind River Workbench or the GNU GCC toolchain and interface to the LabVIEW FPGA code running on the FPGA. Developers also can program the processor using the LabVIEW Real-Time Module, which includes tools for low-level system debugging and precision execution timing for increased flexibility and functionality of deterministic real-time applications.

Figure 2.  Choose a C/C++ development environment based on which hardware platform and operating system meets your application requirements.

The FPGA Interface C API includes nearly all the same functionality as the existing LabVIEW host interface, including the ability to read and write FPGA front panel controls, target-to-host and host-to-target DMA streaming, and IRQ assertion and acknowledgement. 


Using the FPGA Interface C API

The following steps outline the development process. For detailed instructions, refer to the FPGA Interface C API Help documentation:

  1. Develop and compile your LabVIEW FPGA VI. This produces a bitfile.
  2. Launch the FPGA Interface C API generator. Based on the bitfile, a C header file is generated.
  3. Include the header file in your C/C++ application.
  4. Build and deploy the application to the embedded target.


Download Required Software

Required software for FPGA development:

  1. LabVIEW (Full or above)
  2. LabVIEW FPGA Module
  3. NI RIO Device Drivers

Required software for C application development:

  1.  FPGA C Interface API

Optional software for application development

  1. LabWindows/CVI ANSI C IDE
  2. LabWindows/CVI Real-Time Module
  3. LabVIEW Real-Time Module


Learn More

» View the tutorial for building a FPGA host application in LabWindows™/CVI

» Access the FPGA Interface C API Help Documentation

» Learn more about C/C++ Embedded System Design Tools

» Learn more about NI R Series multifunction RIO


Was this information helpful?