LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA I/O doesn't work when called via C interface

I have a VI running in a PXI-7851R that reads the state of some DIs and outputs some signals on some DOs.  When I run the VI in interactive mode I confirm that all my signalling is correct on an oscilloscope.  

 

The input to this VI are some integers which some logic is applied to that results in some output on the DOs.

 

The intent is to interface to this VI via the FGPA C interface.  I've confirmed that I'm loading the bitstream without any errors, I'm creating a session without errors, I'm starting the VI without errors.  The NiFpga_WriteXXXX() functions return a status of NiFpga_Status_Success.  However the I/O is never triggered - I get nothing on my scope.  I've verified that all the intermediate math is being done and that the block that contains the FPGA I/O writes should be executing.

 

What's more curious is that if I single step through my C code in the debugger the FPGA I/O almost always works properly.

 

The system config is as follows:

LabWindows/CVI 2010 App -> Windows DLL (VS Express 2010) -> NI FGPA C Interface -> LabView VI (FPGA) -> PXI-7851R


0 Kudos
Message 1 of 2
(2,461 Views)

Hey dachelb,

 

I want to make sure I understand exactly what's occurring. It sounds like you've written and compiled your FPGA code in LabVIEW and when you run it interactively it runs properly. Is this the case? Next, you use the FPGA C Interface to create a CVI Program that communicates with the FPGA. When you run this program, you don't receive any errors right? However, it also doesn't behave as expected unless you step through the code. You said that you're monitoring for success based on the output to your oscilloscope. Is the output of the FPGA dependent on seeing a certain level on the input? If so, I'm wondering if the FPGA is simply executing and the CVI code isn't catching it unless it's waiting for inputs when you step through it. You may try slowing down your CVI code with waits. 

 

There's also more information about using the toolkit with R Series cards, as well as an example, here:

 

Building a R Series FPGA Interface Host Application in C

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x5DNCAY&l=en-US

 

Hope this helps!

 

--Ryan S.

0 Kudos
Message 2 of 2
(2,426 Views)