Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

data acquisition

I have USB6289. 'm trying to use DAQ assistant to do data acquisition in labview. (the DAQ assistance is directly linked with Write Labview Measurement File  to save to a outside exl. file). For the acquisition mode, I want continuous recording until stop. I select acquisition mode to be continuous samples, but how to set the "samples to read"  and rate? It seems it won't accept large numbers, e.g. 1G. In fact, I may collect data for long time(more than half an hour). What's the best way for setting?

 

In singal experess, I have similar problem for setting the Timing settings, so that I can collect all the data until physically stopped. How should the setting be in signal express? 

0 Kudos
Message 1 of 20
(4,464 Views)

Hi kgy,

 

Heres an example code that should work. I am not aware of any issues with 1G samples to read, unless the DAQmx read timesout or you cant buffer enough data.

 

Let me know how you get on,

Regards,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 20
(4,446 Views)

Hi Kgy,

 

The reason samples to read cannot be set to 1G is mostly likely because you cannot allocate enough memory to handle that much data.  If you set the samples to read to 1G, your computer has to be able to hold all of those samples in memory at one time.  If you need to collect a large amount of data, I would recommend acquiring it continuously in smaller sets of data and just controlling how long it runs.  For example, if you need 1G of samples at 1KHz.  Then you can read a 1000 samples at a time and transfer those to hard disk each iteration of a for loop.   From there you can control the number of iteration to just acquire the 1G samples.  For my above example, it would need to iterate 1M times.  Below is some code that demonstrates the behavior I'm talking about.

 

 

 

In LabVIEW SignalExpress, you can do the same thing by placing your DAQmx acquire and write to file steps inside a conditional repeat for the number of iterations you want.  This will again acquire smaller number of samples each time.  It is important also to understand that in both examples the task is not stopping.  It is acquiring data continuously and just fetching data from the buffer in smaller chunks that your memory can handle.

 

Note: Make sure you run once and not continuously in SignalExpress.

 

I hope this helps,

Paul C. 

Message Edited by Paul C. on 08-18-2008 11:04 AM
0 Kudos
Message 3 of 20
(4,441 Views)

Many thanks, Hilman and Paul. Unfortunately, I can't open the file sent by Hilman due to version problem. I'm using version 7.1.

 

Paul,

I've made the same program as you gave. Unfortunately, the while loop does not seem work.It stoped after collecting the number of sample I specified. please refer to attachment for my setting.  Is there anything wrong?   Or  did I miss any settings in the  DAQ assistant?

0 Kudos
Message 4 of 20
(4,424 Views)

Hi Kgy,

 

You have to set the DAQ Assistant to acquire data continuously.  Here is a picture of how I had mine configured.  

 

 

In addition, you may want to consider wiring the error clusters so it will stop the loop if there are errors. 

 

Regards,

Paul C. 

Message Edited by Paul C. on 08-19-2008 10:38 AM
0 Kudos
Message 5 of 20
(4,400 Views)

Thanks a lot. I found the error. It's in the write to measurement file. I set enable at "i==1"; then it only write to the file once. Now it works fine.

 

 

0 Kudos
Message 6 of 20
(4,377 Views)

Paul:

 What is the best way to real-time display all the acquired data into a graph? Now the waveform graph is placed into the loop, so each time only part of the acquired data is shown in the graph. How to real-time display all the data?

0 Kudos
Message 7 of 20
(4,335 Views)

Hi kg_yan,

 

Unfortunately, there is no real means of of viewing absolute real-time data on a non real-time target. However, by placing the waveform graph in the while loop as you did and by carefully selecting the number of samples to read, you should be able to get fast updates on your graph. For example, for large read samples, your DAQmx read will wait until the required amount of sample points are acquired in the buffer before returning the data to be displayed on your graph. So depending how long it takes to acquire this data, the graph might update slowly. On the other hand, if you set this number too low, you may not be emptying your buffer fast enough and therefore you might run into buffer overflow problems. If you simply want to empty all contents in the buffer at every read, which I recommend, you could wire a -1 constant in your number of samples per channel. Like this, the graph will update as fast as it can with whatever data in your buffer.

 

I hope this helps,

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 8 of 20
(4,306 Views)
Hi kg_yan, I believe I have perhaps misread your question. I believe you can simply use a waveform chart instead of a waveform graph. You will then be able to view all your past data on one graph. You may also enable the X-scrollbar by right-clicking on your chart in the front panel and going to Visible Items » X-Scrollbar. Sorry for the confusion.
S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 9 of 20
(4,299 Views)
It works! Many thanks! However, there is one issue. Each time when I restart a new data collection, the old data from previous collection were still displayed there. How to remove the old data and restart with an empty graph only showing all the data in current loop of collection?
0 Kudos
Message 10 of 20
(4,282 Views)