LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FIFO missing data

Solved!
Go to solution

Hello everyone!

i'm currently acquiring data from two different kind of sensors using a cRIO9039 and labview 2016. Since i use both a NI9234 and NI9220, who have different clock rates, i need to use 2 FIFOs to pass data from my FPGA side to my RT side.

SAR acquisition loopSAR acquisition loopDSA acquisition loopDSA acquisition loop

Both loops are written so they acquire data at 12.8kHz. In the SigmaDeltaFIFO i put 4 values each iteration, in the MEMS FIFO it's 32 values. In the RT loop i read out the data and decimate it back into the seperate measurements.

SAR RTSAR RT

My RT system uses a Wait until next ms multiple function to execute every 20ms multiple. I played around with this value and the problem occurs more often at higher values (>50ms) and also more often when going to lower values (<5ms).

Now to my problem:

The Elements Remaining of the MEMS FIFO should always be a multiple of 32. During a 10 minute measurement i sometimes get a TimeOut error from this FIFO and have only 31 Elements Remaining. What could be the reason / solution?

This problem does not occur during every measurement, and it never occurs at the same time. Sometimes it happens after 30 seconds, sometimes after 9 minutes.

fifointerfaces.PNGfifogeneral.PNGDatatype: SGL

It would be great if any of you could help me with this problem.

Download All
0 Kudos
Message 1 of 4
(2,645 Views)

I wouldn't put a wait in the read loop. Read as fast as possible, and let the TO of the read introduce a wait if it's idle.

 

The feedback node in that FIFO write loop probably isn't right. It will remember status from previous iterations, so an error of the 4th element will be remembered for the next 1st element. You probably want to use a shift register for that.

 

If there is an error, you're in trouble, and it will be impossible to recover anyway. Once multiple channels over a single FIFO are out of sync, there's no way for the reader to get back in sync.

0 Kudos
Message 2 of 4
(2,603 Views)
Solution
Accepted by topic author LReck

I'm neither a RT or FPGA savant, but you can try this on the RT side:

  1. Configure the depth of the FIFO; should be 5-10x times the read size.
  2. Read the buffer every 100-200ms; I used 200 ms in my application.
  3. So in your case, 12.8kHz, in 200ms, 2560 points, times 32 channels, make the depth 2560*32*10 = 819200
  4. Read 163840 elements every 200 ms.

Below are some images.

800kSa/s, 4 channels800kSa/s, 4 channelsRead data every 200ms, amount of data needs to be larger than 4*160kSaRead data every 200ms, amount of data needs to be larger than 4*160kSa

mcduff

 

Message 3 of 4
(2,586 Views)

Okay, it's running smoothly now. I ran tests for a couplt of days under different settings and i haven't encountered this error yet! Thank you!

0 Kudos
Message 4 of 4
(2,550 Views)