LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why use FIFO to read analog signal?

Why must we use FIFO to obtain analog signal from FPGA? I can use a normal method of calling the FPGA using Read/Write Control and the results in a waveform chart is much more smoother. 

0 Kudos
Message 1 of 5
(2,450 Views)

On your FPGA Host, you can read that front panel control once every loop. The fastest you can guarantee that it will run through timed loops is once every 1 ms. That's a sampling rate of 1 kHz.

 

On your FPGA Target, your acquisition can run as quickly as your sampling rate and the loop in which you're running. My 7842R can acquire analogue inputs at 200 kHz on a 40 MHz clock, so a tick delay of 400 in a single cycle timed loop means I'll take a data point once every 0.01 ms (or 100 kHz)

 

I'd miss crucial samples if I just read the indicator every 1 ms. So instead, I put the data into a FIFO and read it back in larger chunks - 10 000 datapoints per channel every time, meaning I can run my loop on my host at a 100 ms period and not lose any data.

 

FIFOs are definitely the way to go for data acquisition. Control/Indicator updates are good for stimuli, such as enabling a digital power line or checking the state of a switch.

---
CLA
0 Kudos
Message 2 of 5
(2,444 Views)

But when I used FIFO, the waveform chart seems to be going from a value to zero and next to a value. Why is it happening? I connect it with 2 FIFOs and connect 0 to element and timeout. The first FIFO's element remaining connect to the second FIFO's data. I think this method is widely used by when I connected it to a waveform chart vs time, it somehow keeps dropping to zero (within a few miliseconds) before the next value.

0 Kudos
Message 3 of 5
(2,433 Views)

If you post your VIs, I can try to have a look at it later.

 

Meanwhile, have a look at this page:

 

http://www.ni.com/white-paper/4534/en

---
CLA
0 Kudos
Message 4 of 5
(2,428 Views)

I've uploaded 2 real-time VIs with and without FIFO. MQ convert is the subVI in my computer. Do have a look at it...

 

My waveform chart is done that way so that I can easily export to excel ( i think) but this is a different problem in a different topic http://forums.ni.com/t5/LabVIEW/3-Waveform-Chart-to-a-Single-Excel-but-in-Different-Spreadsheet/m-p/...

0 Kudos
Message 5 of 5
(2,408 Views)