LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FIFO. read number of elements interfere with the data

Does changing the numbers of element under FPGA interface Invoke Method's function "FIFO.read" vi change the outcome of the data? How and why does it change? How to I find the suitable number of element to fit the channels I have?

0 Kudos
Message 1 of 3
(109 Views)

That depends on data coming back.  Do you know how much is coming back and how often?  This should be understood and known.

 

Do you need to read and then take the elements remaining and feed it back to the Read FIFO function.


Certified LabVIEW Architect, Certified Professional Instructor
ALE Consultants

Introduction to LabVIEW FPGA for RF, Radar, and Electronic Warfare Applications
Message 2 of 3
(107 Views)

So if you request 2000 elements and there aren't currently 2000 elements in the FIFO, this function will block for up to 5 seconds. If at that point you still don't have 2000 elements it will throw a timeout error (possibly warning I don't remember). However, if you never get 2000 elements to read, none of the data sitting in the FIFO will be lost.

 

A pretty common strategy will be to input 0 for both "Number of Elements" and "Timeout (ms)" and use the "Elements Remaining" output to decide how much data to read. For data you may be streaming to disk, you could just simply read however many elements were remaining (in this case you're reading 0 elements, the Read method tell you that there are X elements remaining so you then turn around and say okay I'll read X elements). Depending on how data is being packed or processed it's also pretty common to use a modulo function on the elements remaining output to read some multiple of elements (if you're FIFO is representing CAN data it may be helpful to make sure you're always reading a full frames worth of data even if you're leaving a few elements in the FIFO).

Matt J | National Instruments | CLA
Message 3 of 3
(101 Views)