02-05-2022 10:03 AM
Hello,
Solved! Go to Solution.
02-05-2022 02:56 PM
1. You should be using a DMA FIFO to pass your data from the FPGA to the host. Otherwise, you are just getting the values when the host just happens to decide to look at the variable. This is your main timing issue.
2. Excel is limited in how many lines it can show. If you want to see more from a TDMS file, then you will want to look at either DIAdem from NI or Scout from Signal.X.
I would have to do some major digging to figure out how to really interface with your FlexRIO. Not an architecture I would recommend for a newbie.
02-05-2022 05:29 PM
Open, run, and review all of the examples listed here: https://zone.ni.com/reference/en-XX/help/372614J-01/friotransamr/5781_transceiver_clipref/
02-07-2022 02:23 PM
Hello,
Here are some thoughts and suggestions on your issue:
Regards,
Vineet
02-11-2022 03:49 PM
Hello crossrulz,
Thanks for your suggestion! I have tried to use the DMA FIFO to pass the data, and my new block diagram is shown below. The size of the FPGA DMA FIFO is 1024 and in the host end I set the FIFO depth as 4096 and want to read 1000 data at a time.
What I want to do is like what Vineet said below, to put the DMA channel in a single loop, the math calculation in another loop, and pass the data to the TDMS file in a third loop. However, as the data output from the DMA channel is in the form of 1D array and it seems like I can not directly use the array to do the mathematical calculation in loop 3, I want to extract the elements in the array to do the math calculation and present them on the waveform. I use the 'index array' function, but I think it may only give me the first element of the array, right? But if it is not feasible, what should I do, or which function should I use without changing the function in loop 3?
Another problem I met is the loop and sampling time. I use the loop one to measure the sampling time by measuring the number of iterations of loop 2 per second, multiplied by 1000 (as I set the number of element as 1000 in the DMA channel). What I get is about 400k to 500k samples/s if I do not write data to the TDMS file in loop 4. If I enable the boolean button and write data to the TDMS file, the sampling rate increases to 1M Sample/s. Why is there such a difference?
When I observe the TDMS file, I found the speed is much slower than the sampling rate I measured. For example, I run the program and write to the TDMS file for 10 seconds, I only get less than 1000000 data, which means the data speed into the file is less than 100 K/s and it is much slower than the sampling rate. Is there anything that I did wrong in my program?
02-14-2022 04:43 AM
And this is my VIs if necessary.
02-14-2022 10:57 AM
Hello,
I think you're getting closer, but here are a few things to watch out for:
Regards,
Vineet
02-15-2022 04:23 PM
Hello Vineet,
Thanks so much! I have tried your method and most problems are solved. However, I am still a little confused about the concept of DMA FIFO. Is it a physical component on the FPGA and host machine, or just an abstract concept that does not actually exist?
Regards,
Xun Zou
02-15-2022 04:27 PM
@XunZou wrote:
However, I am still a little confused about the concept of DMA FIFO. Is it a physical component on the FPGA and host machine, or just an abstract concept that does not actually exist?
See https://zone.ni.com/reference/en-XX/help/371599P-01/lvfpgaconcepts/fpga_dma_how_it_works/
DMA-FIFOs have buffer elements that exist on the Host and FPGA.
02-15-2022 04:29 PM
Hello,
Now I get it, thanks!