NI Labs

cancel
Showing results for 
Search instead for 
Did you mean: 

C Interface to LabVIEW FPGA

julesjay,

 

I think I know where the confusion is. NiFpga_ConfigureFifo only configures the host memory side of the FIFO. But the FIFO on the FPGA holds elements as well. So the total number of elements your FIFO can hold is essentially the sum of the host memory side and the FPGA side. The size of the FIFO in the FPGA is configurable from the LabVIEW Project, and defaults to 1029. Does this make more sense?

0 Kudos
Message 61 of 79
(5,441 Views)

Yes I was confuse but still I don't understand what is this for?

 

I've cheched NI-RIO FIFO example and there isn't any FPGA_ConfigureFifo function? Is this function needed?? 

 

My DMA Fifo is configured in my LabVIEW project (4095 U8). Then I compile FPGA VI and then generate C API files (LVbitx). 

 

Is this enough to work properly Or do I need to configure something in C application?

 

When I use an FPGA card using LabVIEW I don't need to configure a FIFO DMA in the host! Or maybe it's automatic?

 

Thanks

 

James

0 Kudos
Message 62 of 79
(5,421 Views)

julesjay,

 

This function is optional, which is why you don't see it used in the example. Please see my reply on 9-11-2009 for more documentation on this function.

0 Kudos
Message 63 of 79
(5,414 Views)

Ok for this point.

 

Can you explain this : 

 

I've configure a DMA FIFO with 255 U8.  In My FPGA I placed the function : Get Number of Elements to Write.

I run the code in simulation mode and it returns 10255? 

 

Any explaination? Shouldn't it be 255? and 254 after I put one element in the FIFO and so on?

 

Thanks

 

James

0 Kudos
Message 64 of 79
(5,406 Views)
julesjay,

 

That actually makes sense, as the minimum size is 10000, and it looks like the numbers were just added together.

 

These questions are actually not specific to the C API, but the FPGA Interface in general. I suggest you try the general LabVIEW FPGA forum: http://forums.ni.com/ni/

0 Kudos
Message 65 of 79
(5,391 Views)

I am trying to read a FIFO and am getting a status error of -50400. Any idea what this is?

 

I can verify the status error -63101 by misplacing the bit file, so I'm pretty sure the error is correctly displaying.

0 Kudos
Message 66 of 79
(5,372 Views)

harBenger,

 

Yes, that is an error code that we forgot to document! It's the error you get when a FIFO operation times out. This happens when you specify a finite timeout and the operation does not complete in time. We will be documenting this error in the next release. Sorry about the confusion.

0 Kudos
Message 67 of 79
(5,369 Views)

I found another one...

 

-52012.  The error explanation (Help>>>Explain Error) says "There is no more data available to read or no more space available in which to write." This is pretty vague...

 

Since I'm playing with IRQ's now, I'm assuming it's an IRQ issue. 

0 Kudos
Message 68 of 79
(5,323 Views)

harBenger,

 

I think I found the problem. It looks to me like you may be calling NiFpga_WaitOnIrqs on an NiFpga_IrqContext that was never reserved with NiFpga_ReserveIrqContext. In future releases, this will probably return a more descriptive error like NiFpga_Status_ResourceNotInitialized.

 

Let me know if this isn't what's happening, and thanks for the feedback!

0 Kudos
Message 69 of 79
(5,320 Views)

Hi,

 

I'm AE in NI Taiwan.

Many of our customers want to use "C interface to labview FPGA" in Borland C++.

Could this API be used in Borland C++?

 

Thanks,

Ziva

0 Kudos
Message 70 of 79
(5,296 Views)