This document contains an FPGA Interface C API example for use on NI Linux Real-Time targets. It was developed in the C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition.
The purpose of this example is to demonstrate the various host to FPGA communication mechanisms available in the FPGA Interface C API, all in one application, as a supplement to the existing FPGA Interface C API examples. The application is relatively simple, and is intended to be run from the command line in NI Linux Real-Time. The example uses the following Host-to-FPGA communication methods:
To use this example, please install and configure the Eclipse tools to ensure that you have the ability to cross compile and deploy to a Linux Real-Time target. To do so, follow this tutorial: Getting Started with C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition.
You will then need to import the C project into your workspace in Eclipse.
Note: You will also need to link against libdl in order to use any RIO driver functions. To do this, open up the Properties dialog for your project. Then expand the C/C++ Build section and select Settings. Under the tab Tool Settings, expand Cross G++ Linker and then select Libraries. In that category, add "dl" under the Libraries (-l) header.
The attached zip file contains LabVIEW code (LabVIEW FPGA and a LabVIEW Real-Time test VI) as well as C code. The example was built for a cRIO-9068, so if you are using that target then you do not need to open or recompile the LabVIEW FPGA code, as long as your NI-RIO version is still compatible. If you do need to recompile the FPGA code, download the FPGA Interface C API. Then follow this tutorial to learn how to use it:
Before running the application, ensure that you have transferred the FPGA bit file ("NiFpga_FPGA.lvbitx") to your target to the same directory that you deployed your built C application.
Please note: This code is still in beta and may contain minor errors