03-22-2016 11:30 AM
Hi, Labview experts!
Is there anyway to save analog data from FPGA VI to host computer?
I knew how to transfer Analog data from FPGA to host computer by using DMA FIFO.
I'd like to know how to save data like a file format such as excel, etc which I can read or transform it to readable file.
(Samping rate of Analog data is almost 20kS/s.)
Thank you
03-22-2016 12:02 PM
Of course you can write data to a file. Open the file outside the loop, then inside the loop read from the FIFO and write to the file, then close the file when the loop ends. The file could be a text file, delimited with tabs or commas, which you can easily open in Excel but is not efficient in speed and space, or you could use a binary format such as TDMS. There are examples of both that ship with LabVIEW. You can open TDMS files in Excel using the plugin that is supplied and installed with LabVIEW.
03-22-2016 01:27 PM
You should also have a look at the Producer/Consumer design pattern. The idea is to put your file writing in another loop so as to not slow down your read/processing loop.
03-22-2016 07:58 PM
Is there a good example for this application?
I can't get a concept of this application.
Your explanation is really good and straightforward, but it's quite difficult to get the point the first sentence.. Open the file outside the loop and.... write to the file... I'm sorry about asking you agian.
I hope I can understand your explanation soon.
Thank you so much!
03-22-2016 08:30 PM - edited 03-22-2016 08:31 PM
See if this helps
03-26-2016 05:52 PM - edited 03-26-2016 05:55 PM
Hi, NI experts
I'd like to hear some opinions about this problem from you.
I tried two ways to save data in TDMS file.
1) Read/write function from FPGA to host computer seems to lose a lot of data points because of the high sampling speed (40us / 1data).
2) DMA FIFO function showed an error right after I turned on TDMS function.
=> error -50400 occurred at Invoke Method: FIFO.Read in TDMS_DMA FIFO_rev 3.25.vi
Possible reason(s):
NI Platform Services: The transfer did not complete within the timeout period or within the specified number of retries.
I think samling rate of data caused data transfer via FIFO to be overflowed because of elements number for data in a short time.
Thank you.
03-26-2016 06:56 PM
It would help if you showed some code. If you followed the Producer/Consumer setup and read enough samples at a time, there should not be any issue.