11-26-2009 06:05 AM
Hi, I am new to LabView. I am using the DAQ assistance to get my signal that sampling with 1MHz.I want to save the data into waveform file or binary file. Is there any clue to save the data continuously in waveform or binary file?
Thank you.
Sue
11-26-2009 06:59 AM
Hi Sue
There are multiple ways of doing this, the simplest is just to stay with the express VIs and use the "Write to Measurement File" ExpressVI. What you have to keep in mind is that writing data to file is time consuming. If you try to write your data to file in the same loop at the same time as you read it using the DAQ Assistant it can cause you to miss samples. To avoid this either buffer your data and just write it once to file when the acqusition is done. This however may not be practical depending on how much data you intend to read. The best solution is to work with two loops, one reading the data and one writing it to file. This is called a Producer/Consumer Architecture. There is a template for it if you choose File-> New and then navigate to VI-> From Template -> Frameworks -> Design Patterns -> Producer/Consumer (Data)
Hope this helps
Best Regards
David
NISW
PS. The missing samples problem is not an issue if you are just acquring a finite number of samples. DS.
11-26-2009 09:17 AM
Thanks David. I have try to put the DAQ assistance in a loop and transform to waveform before i write to a file. I put the write waveform to file in separate loop that is outside of the loop of DAQ. However,the file can not be found on the specified file path that i put. Is there any suggestion?I want to do something similar as the link below.
http://forums.ni.com/ni/board/message?board.id=170&message.id=189059&query.id=240237#M189059
but i want to a file once at the end.
I did try to put the write waveform to file in a case structure loop but still the same problems.
Thank you very much.
Sue
11-26-2009 09:30 AM
Hi Sue
Could you post your code so I can have a look at what you are doing?
Best Regards
David
11-27-2009 07:38 AM
Hi David, I have try with the write waveform into file in the same loop as the DAQ assistance and the programme is works but I think only the first interation is written to the file.When i try to read the file, only the data for first interation is display on the graph so I am not sure about this. I have post the codes here. I try with 3 simulate signals first then I will replace with DAQ assistance if the programme is work.
Thank you.Have a nice day
Sue
12-01-2009 03:11 AM
Hi Sue
I think your problem is that you are overwriting the data, not appending.
Here's how I would probably do it if I was using Express VIs and doing a continious acquisition(The DAQ Assistant is configured to acquire 3 channels of data).
This is a Producer/Consumer design were you read the data in one loop and write it to file in another. I would recommend writing to a TDMS file. You will also have to play around a bit woth the acqusition settings (number of samples to acquire and timing on the top loop)
Best Regards
David