Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous analog and digital acq to file problem

Hello 

 

My task is to acq 2 analog and 1 digital input in high sampling rate and save them to a text file for later analysis. And i am using usb-6251 mass term daq card.

 

Actually i am a new labview user  acoording to examples and posts to this forum i have created a vi. Everything seems ok when i run the file txt file is created where i want. But when i open the file. Number of data is less then i expect. For example i set to rate 100k and run the vi for a few seconds it consists about 1000-1500 samples. 

 

I am working on this task about a week. My vi file is attached. could you look it at give your opinions please.

 

Thanks for your helps in advance.

 

0 Kudos
Message 1 of 5
(2,976 Views)

Your comment about a high sampling rate and your code does not match. You are taking only a single sample with each loop iteration. The total number of samples is dependent on software timing.

 

If you change to multiple/hardware timed acquisition, you will probably need to change the way you save the data. Writing to a text file is slow. Stream to a TDMS file or use a producer/consumer architecture with the file write in the consumer loop. There are shiping examples that you can look at.

0 Kudos
Message 2 of 5
(2,968 Views)

Thanks for quick reply

 

Should i also change the 1 samp method to waveform method. I tried it but i couldn't find a way to bundle analog and digital waveform. Is it easier when saving to tdms file?Also can tdms file saver save txt files, actually i will open this files in matlab.

 

How can i find that examples could you please write  few names of them, if they are grouped in a topic what's the name of topic.

 

 

0 Kudos
Message 3 of 5
(2,946 Views)

Help>Find Examples>Hardware Input and Output>DAQmx>Analog Measurements>Voltage.

0 Kudos
Message 4 of 5
(2,937 Views)

Hi Baris,

 

TDMS streaming would probably be your best option. Here is an example program that performs a continuous data acquisition that streams the data directly to disk http://decibel.ni.com/content/docs/DOC-11300. If you do not want to use TDMS, Dennis also suggested you use a producer/consumer architecture to acquire and write the data to disk. Here is an example of such a program http://decibel.ni.com/content/docs/DOC-2431 . Also, are you trying to synchronize your digital and analog acquisitions? If so, you would want to configure your dependent task (in your case the digital input task) to start before the task providing the sample clock (your analog input task). Here is such an example http://decibel.ni.com/content/docs/DOC-12185

 

Best,

Sean Ferguson
Application Engineering Specialist | RF and Reconfigurable Test
Message 5 of 5
(2,913 Views)