Installed the NI LabVIEW 32bit version, installed the NI FPGA Interface C API Generator, installed the hardware pcie-7842r
- Open FPGA Interface C API Generator, before importing the FPGA bitfile generated with LabVIEW; A.bitfile
- Click on generate to generate a few files: 1. FPGA Bitfile; 2.nifpga.c;3.nifpga.h;4.nifpga_a.h;5.nidist.id.
Where nifpga_a.h contains the constants required for function calls in the application, which are macro definitions or enumeration type constants, such as:
1typedefenum2 {3Nifpga_stepmode_controli16_framamp =0x811e,4Nifpga_stepmode_controli16_framoffs =0x8122,5Nifpga_stepmode_controli16_framstep =0x811a,6Nifpga_stepmode_controli16_lineampl =0x8132,7Nifpga_stepmode_controli16_lineoffs =0x8136,8Nifpga_stepmode_controli16_linestep =0x812e,9} nifpga_stepmode_controli16;
These constants include the Bitfile name, the digital signature, and the offset address of the register in the FPGA;
NIFPGA.C and NiFpga.h are the same for all projects, including various system functions that call NI FPGAs.
- Create a new Visual Studio console application,
There are example on the computer about the FPGA Interface C API Generator
Reference documents:
- The C API Usage description of the R-series FPGA given by the official website http://www.ni.com/tutorial/8638/en/
- The FPGA Interface C API Generator given on the computer example
Using the visual Studio deploy NI FPGA board (with FPGA Interface C API Generator)