LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save dynamic data from DAQ system into waveform file/binary file

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

0 Kudos
Message 1 of 6
(7,748 Views)

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. 

0 Kudos
Message 2 of 6
(7,739 Views)

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

0 Kudos
Message 3 of 6
(7,727 Views)

Hi Sue

 

Could you post your code so I can have a look at what you are doing?

 

Best Regards

 

David

0 Kudos
Message 4 of 6
(7,720 Views)

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

Download All
0 Kudos
Message 5 of 6
(7,700 Views)

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).

 

ExpressProducerConsumer.png

 

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

Message 6 of 6
(7,629 Views)