Getting flow sensor frequency using FPGA and using DMA FIFO from target to host. Not getting correct number of samples in output TDMS file and unable to get correct number of pulses from flow sensor.

Hey guys, I have been trying to get a flow sensor reading by counting the number of pulses given out by the flow meter.

I use NI 9205 analog input module in differential mode with 9.5 to 10 Volts and 11 mA excitation from a voltage generator, with a Compact Rio 9036. The frequency output from the flow sensor is 40Hz to 1200 Hz. The sampling frequency is 2 KHz(1/(20,000 ticks*25ns)) where 25ns is the FPGA clock rate.

Using DMA FIFO, the data is acquired by the rt loop-

Problems;

1. instead of getting 120,000 samples (2khz*60sec), I get only 24,000. why?

2. I counted the pulses in matlab but I get only around 900 pulses in a minute. I guess this is obvious from point 1?

I have attached the VI's, the TDMS files with readings for 1min with constant flow of around 1.05 litres per minute, second VI where flow is reduced from 1.05 litres per minute to a lesser one and then to 1.05 lpm again

and the flow meter specs

Can someone please advise me what to do here? As I've been breaking my head over this for 10 days. I'm new to labview and data acquisition.

Re: Getting data from FPGA using DMA FIFO from target to host

I used that link in your previous message, but in general it is preferred to find every needed file in a ZIP, attached to your message in this forum. (Sometimes there can be problems to access 3rd party websites!)

Re: Getting data from FPGA using DMA FIFO from target to host

Dear GerdW, can you help me understand what happens to the signal when it goes through the NI 9205 ?

As the flow sensor gives out push pull type pulse outputs. It is connected to the NI 9205 which has an ADC therefore shouldn’t I be getting a digital signal in labview through the compact Rio ? What is happening exactly ?

Also, if I’ve set the sample rate at 2 KHz, I should be getting 2000*60 sample points in the TDMS file right ?

Re: Getting data from FPGA using DMA FIFO from target to host

next time please attach the full project: without your lvproj file those FPGA/RT VIs are pretty senseless…

Why do you need to use SGL data in your FPGA VI? Why not stick with FXP and integer data?

Why are there several charts in the FPGA VI? The FPGA is not able to show a frontpanel on a monitor!

Why is there an additional wait function inside the TWL of your RT VI? (Palm face!)

Why do you need a TWL at all when the loop needs to wait on a certain number of samples in the FPGA FIFO?

Why do you need to reshape a 1D array into a 2D array of just one row???

In relation to the bolded part: Having a chart on the FP of a FPGA VI can be immensely useful when debugging (and connecting to the VI in interactive mode can help show some possible problems). I do this a lot, but I also tend to have the Chart on a VI which calls the actual FPGA VI as a sub-VI (and plotting a GBL to the chart) allowing me to test with chart but deploy without. So this point would have been low on my personal list of things wrong.