LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sampling rate for long duration data acquisition

Hi,

      I am using NI cDAQ 9178 chassis with NI 9235 module for strain measurements. I need to acquire data continuosly for 2-3 months. How can I set up my sampling rate? Should I use time delay in while loop for this? 

 

Thanks

 

Piyush

0 Kudos
Message 1 of 12
(5,679 Views)

Hi Piyush,

 

To acquire the signal from the field you can use DAQmx functions.

 

When you configure the Software Timing for your task in LabVIEW, you are essentially configuring the first transfer from card to RAM. This buffer is abstracted away in the hardware and is separate from any accessible data in software. One of the inputs to the timing VI is Samples per Channel.

 

Likewise, when you configure the software, you are essentially configuring the second transfer from the buffer to the software. In this there is an input called Number of Samples per Channel. When the task sampling mode is set to continuous, the Number of Samples per Channel input sets the size, in samples, of each chunk that is read from the buffer into the software.

 

It should be noted that the acquisition waits until a chunk of data at least that big exists in the buffer before it will take the data off of the buffer and into the software for processing. Therefore if the sampling rate is not sufficient to create a chunk of this size in the time allotted by the timeout, the software will throw a timeout error. To prevent this, increase the timeout or reducing the chunk size. In Software, you also have the option of entering -1 as the value, which is the default setting in LabVIEW if none is set. When set to -1, the Software will read all data is available in the buffer.

Sampling Rate: - specifies the sampling rate in samples per channel per second.

One of the most important parameters of an analog input or output system is the rate at which the measurement device samples an incoming signal or generates the output signal. The sampling rate, which is called the scan rate in Traditional NI-DAQ (Legacy), is the speed at which a device acquires or generates a sample on each channel. A fast input sampling rate acquires more points in a given time and can form a better representation of the original signal than a slow sampling rate. Generating a 1 Hz signal using 1000 points per cycle at 1000 S/s produces a much finer representation than using 10 points per cycle at a sample rate of 10 S/s.

Number of samples per channel:- specifies the number of samples to read.

 

Time delay you can set based on your number of sample to read. No need to use time delay function.

 

Thanks and regards

Himanshu Goyal

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 12
(5,666 Views)

Hi Himanshu,

                    Thanks for your information. I am still not being able to control the sampling rate. I changed the samples to 1 and rate to 1 Hz for 1 S/s sampling rate. But, the file shows that it is reading samples more frequently (794 samples/s). And, if I continue to run program for long duration (1-2 months), the file may be too large. I am not sure, if it can accommodate that much data. For that reason, I just want to acquire data in 30 minutes duration, just to make sure that file is not large.

 

Thanks

 

Piyush

0 Kudos
Message 3 of 12
(5,648 Views)

Dear Piyush,

 

In one of my application I already work with this file or data management system. I feel you can use TDMS/Binary file format to store the data.

This data is very less data to store, You just create the files on Daily basis. This program execution totally depend on your code how you manage the data, transfer the data or your file management system.

For more information previously I post one discussion form of my project and its working fine. See this Link.

 

Thanks and Regards

Himanshu Goyal

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 4 of 12
(5,639 Views)

Hi All,

 

I am having the same problem here.  I want to scan at 10Hz.  I have a cDAQ USB setup with several modules, and the code I wrote allows me to modify which modules are used on a per-run basis.

So if I configure the run WITHOUT the 9235, It samples perfectly at 10Hz (scan clock verified).

However, when I check the scan Clock after configuring a run with a 9235 unit, the scan rate is 793.651Hz (the only difference is that one or more of the specified channels is a 9235 channel).  No matter what I wire into the Scan Clock and Timing nodes, this is the reported rate.

 

Does this mean that the scan rate on the Strain Gauge modules (9235, 36, 37) is fixed, and I will have to downsample to get down to 10Hz?

 

Thanks!

 

Jed

0 Kudos
Message 5 of 12
(5,562 Views)

Hi Jed,

 

The above statements all cover the initial problem with the longer sample rate issue. The scan rate is the rate at which one sample per channel is acquired, and the rate at which the sample clock is set. For more information on the terminology,  this KnowledgeBase article describles the terminology a  bit more in depth. You can set the sample rate/scan rates, and the KnowledgeBase Daqmx Timing and Sample Rates explains about this option.

 

Additionally, the specified scan rate will be a bit different than the actual scan rate. Check out this article for information on these differences.

 

Hope this helps!

Lea D.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 12
(5,541 Views)

A different option would be to sample the data at a normal rate (whatever that is?) and then save data to a file at what ever rate you want.  That way you could watch current data on the front panel and save data at a slower rate.  If you took a sample every 5 minutes it would be ~25,000 points of data and you could plot it in excel. 

 

Or if you use the write file measurement vi you could record data faster and have it write files as often as you want based on number of samples or time.  Many small files instead of 1 large file.

0 Kudos
Message 7 of 12
(5,525 Views)

And how do you do that?

0 Kudos
Message 8 of 12
(5,147 Views)

This may help get you started:

 

Using the Write to Measurement File Express VI

http://digital.ni.com/public.nsf/allkb/CB46BC11A488621E86256D19005A386E?OpenDocument

Applications Engineer
National Instruments
0 Kudos
Message 9 of 12
(5,122 Views)

 

I guess i should have been more specific. How do I sample @ 1000s/s but write to file once a minute? A nested While Loop?

0 Kudos
Message 10 of 12
(5,118 Views)