Welcome to NI Labs C Interface to LabVIEW FPGA
Welcome to the C Interface to LabVIEW FPGA forum. This thread is intended to foster discussion about the project, so please post any questions, comments, bug reports, and other relevant information here.
Of particular interest is feedback on how easily the C Interface to LabVIEW FPGA integrates into the application build process. The C Interface to LabVIEW FPGA is provided by C code that must be compiled into the final application. Some of this code is specific to a particular FPGA VI and must be generated once the FPGA VI is complied into a bitfile. We would like to hear about any difficulties this causes and any recommendations for improving it.
mentioned C interface to LV FPGA is nice feature coming right in time. I was already thinking how to integrate my C code subroutines with the LabVIEW FPGA and this is it. Before I run some performance testing, could you please tell me when will be available access to the either array elements or FPGA memory (and or including DMA)? My goal is to read/write data blocks (~1KB) from/to cross LabVIEW FPGA target to my specific hardware. I am currently working with sbRIO 9612 and the performance of data exchange between FPGA target <-> RT host written purely in LabVIEW is not satisfying me. This is because of complexity of used algorithms.
Thank you for response in advance.
koutnym is right. This feature provides the ability to write programs in C/C++ which interface with LabVIEW FPGA code running on an FPGA target, such as an NI-RIO device. Previously, the only way to accomplish this was to write "host VIs" using the FPGA Interface palette.
I am satisfied with the functionality of C Interface to LabVIEW FPGA. It works fine. I have had only some troubles to compile it using Wind River Workbench version: 3.0 (vxworks-6.6). Include file "stdint.h" provided with vxworks-6.6 is not "compatible" with the include file from the NI gccdist package (downloaded from NI FTP). So I've copied the "stdint.h" library provided by NI to my project directory and then the compilation went ok. So far so good.
I am pretty eager to use either DMA channel, or arrays to exchange the data. Could you please provide me with NiFpga.out library, where is enabled function "NiFpgaDll_WriteArrayU8, NiFpgaDll_ReadArrayU8", at least? It will help I suppose with the data exchange speed. If not possible, I can wait for next release of C Interface to LabVIEW FPGA.
Anyway, good work, thanks for it ;o)
After downloading latest version of C FPGA Interface I tried to rebuild delivered example code using gcc distribution downloaded from NI. I did the build from command line using my own makefile. Previous version of C FPGA Interface passed ok, new version of C FPGA Interface caused syntax error in "NiFpga.h" file. Error is caused when keyword "inline" is used. New version of C FPGA Interface has for some reason conditionally excluded definition of "inline" keyword which might be problem for above mentioned particular version of GCC. I would propose to change keyword "inline" with keyword "__inline__". Then all will work fine same way as before (http://developer.apple.com/documentation/developertools/gcc-4.0.1/gcc/Inline.html). Maybe someone could suggest other solution if this one is not for some reason good.
Back to the provided VxWorks sample code installed in the "\Program Files\National Instruments\NI Labs C FPGA Interface\Example". I have compiled "Example (CompactRIO).vi" for my sbRIO-9612 and then did the rebuild of that example using distributed GCC. I have also used "capigen.exe" utility. All works fine. So far so good.
Then I took my existing project, already working fine with previous version of C Interface to LabVIEW FPGA. Used again "capigen.exe" to be able create "lvbitx" file and did rebuild of using distributed GCC. When I loaded new files to the cRIO, my application is no longer working. From debug console I got something like this:
Above displayed LOG is shortened. Then function "NiFpga_Open" returned following error: -52005 (A memory allocation failed).
I've seen that structure of bitfile is somehow changed... I can't go deeper with the investigation. Could you give me any hint or technical support with this?
Thanks for the feedback regarding inline. What version of GCC are you using?
Sorry to hear you're having problems in your existing project. Please ensure the following:
1. You're building with the latest versions of NiFpga.h and NiFpga.c (with whatever inline tweaks you need to satisfy GCC).
2. You're building with the newly created version of NiFpga_*.h from capigen.exe.
3. You're installing the .lvbitx file created from capigen.exe, rather than the old .bin file or the original .lvbit file.
4. You're passing the path to the .lvbitx file into NiFpga_Open, rather than the old .bin file or the original .lvbit file.
I suspect that #4 is the problem you're having. If that doesn't fix it, please include a bit more of the error output (about a dozen lines from the top and a dozen from the bottom).
As always, thanks for the feedback!