I've successfully compiled and tested some FPGA code for a PXI-7831R using LabVIEW 2010 (Simple reading of ADCs).
I used the FPGA Interface C API (v 1.3) to generate C code which can be called from CVI.
In my C code, I call NiFpga_Initialize() - which works fine, then NiFpga_Open() - which fails with error code -52009. Unfortunately, this error is not documented here: http://zone.ni.com/reference/en-XX/help/372928D-01
I have correctly ensured that the path to my bitfile is absolute (as specified in the documentation, and that the bitfile exists).
Does anyone know what this error means?
Right now I'm completely stuck since there does not seem to be any logical (or documented) reason why I can't use CVI to talk to the FPGA card.
Not sure if this helps but I looked up some internal database and the error code means:
"The requested resource has been marked for deletion and is rejecting new requests."
Check that the resource string you pass to the Open function is correct and that the resource is in a good state. May be try restarting all the systems involved in your setup.
Thanks for the info. I'm running on a PXI-1033 chassis via a ExpressCard MXI link - could this be related? Do you know if anyone has managed to get the CVI/FPGA interface working via MXI?
Moving to a dedicated PXIe-8108 controller in a PXIe-1065 chassis seemed to make the problem go away. Well, the error didnt occur any more but my FPGA VI still didn't seem to work. In all cases, running a host VI (calling the same bitfile) from LabVIEW works fine. I'm running short on time to debug this further so my current plan is to build my host VIs into DLLs, callable from CVI (which I believe would embed the bitfile). Is this a good or bad idea?
Ok so I tried a few more things on the MXI machine:
1. Built a LabVIEW host VI into a DLL. Called the DLL from LabVIEW and from TestStand - worked fine in both cases.
2. Called the same DLL from CVI and the returned error code is -52009 (I passed the error code from the error cluster as the retrun value for the function).
3. Closed CVI and re-ran as administrator (right click on start menu shortcut to CVI and selected "Run as Administrator"). It now works fine!
4. Retried the original code (FPGA C API) under adminstrator - no errors but the code doesnt seem to do anything (should be generating something on one of the FPGA analogue outputs). I've checked the code a few times and can't see anything wrong with it.
So on the strength of this, I think I'm going to continue with my plan to build LabVIEW DLLs. Maybe the C API could be made to work, but the LV DLL solution will get me going faster. It looks as though there is some kind of permissions issue at work here though. Any ideas?
I'm running Windows 7 (64-bit) on the MXI machine.
The dedicated contoller (which did not show the error) was running Windows Vista (32-bit)
Interesting. If I understand you correctly, you get this error both from the NiFpga_Open when called from CVI, and when you use the LabVIEW FPGA Interface palette to create a LabVIEW-built DLL and call it from CVI. Is that correct? Could you confirm that in the latter case, the error is coming out of the Open FPGA Reference Node?