LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DMA FIFO Read Timeout

I am getting a 50400 timeout error when attempting to read from an FPGA DMA FIFO.  I use the polling method for reading from the FIFO, where I first read 0 elements to get the number of elements remaining in the FIFO and then use that number in a second read as the number of elements to read.  The problem is that I am intermittently getting a timeout error on the second read.  It seems that the first read is returning that there are 180 elements remaining but when I attempt to read that many elements on the second read, I get the timeout, and the data elements remaining (from the second read) says that there are 179 elements remaining.  This suggests that either the first read is giving me the wrong number of elements or that the data elements remaing returned in the second read is wrong.  The timeout would make sense if there were really only 179 elements when I attempted to read 180.  I don't understand the discrepency.  I have both timeouts for the read set to 0 (on a side note, why is the precision for the timeout in ms and not us).
 
Any suggestions or comments on what is happening or what I may be doing incorrectly?
 
Thanks,
Kevin C.
0 Kudos
Message 1 of 4
(4,119 Views)
Hi Kevin,

This sounds like some strange behavior you are seeing. Do you get this timeout consistently, or does it work correctly part of the time? If it says there are 180 elements, and then when you try to read 180 it says there are only 179, what happens if you read 179 for the second read instead? Would it work correctly then?

Also, is this a target to host DMA FIFO?
Nick R
NI
0 Kudos
Message 2 of 4
(3,905 Views)
It does work correctly most of the time.  The 180, 179 are not constant values, that is I have seen it fail when it reported 182 elements remaining and I tried to read 182 and it failed stating there were 181 elements remaining.   This is a target to host DMA fifo.  Do you know that if the DMA read on the host side has an error, in this case a timeout, that the return value in data elements remaining is correct? 
0 Kudos
Message 3 of 4
(3,895 Views)
I would not necessarily expect the value in elements remaining to be correct if there is a timeout error. You could do a test where you write a known number of elements to the FIFO so then you know what value to expect. That way we could know if its a problem with not reading correctly how many elements remain.
Nick R
NI
0 Kudos
Message 4 of 4
(3,808 Views)