Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 ratings:
 5 out of 5     Rate this Document

Incorrect Initial Sample with NI 9211, NI 9217, or NI 9219 in NI CompactDAQ

Hardware: CompactRIO>>Analog Input Modules>>NI 9217, CompactRIO>>Analog Input Modules>>NI 9211, CompactDAQ>>Analog Input Modules>>NI 9219

Problem:
When I perform a hardware-timed acquisition with an NI 9211, NI 9217, or NI 9219 in NI CompactDAQ, the first sample that I read is old/stale. The rest of the data I acquire looks fine, but the first sample is not what I expect.

Solution:
When you perform a hardware-timed acquisition with an NI 9211, NI 9217, or NI 9219 in NI CompactDAQ, NI-DAQmx acquires the first sample when you commit the task. You may notice a larger difference in value between the first and second samples of the acquisition than between subsequent samples because the time from task commit to task start is usually longer than the time between samples.

The following image shows the acquisition of a sine wave on an NI 9217 with AI.ADCTimingMode set to High Speed. You can see that first sample was measured from the sine wave, but there is a discontinuity between it and the samples immediately following:

Some C Series analog input modules are specifically designed for measuring signals that vary slowly, such as temperature. The behavior seen above is due to the NI CompactDAQ design which facilitates slow sampling modules to be placed inside a task with faster modules without constraining the acquisition rate of the task.

With the NI 9211, NI 9217, and NI 9219, if the sampling rate of a hardware-timed acquisition exceeds the maximum sampling rate of the module, they will return the same point repeatedly until a new conversion completes (no warning or error is generated). Exceeding the maximum sampling rate of other devices in the same task generates warnings or errors.


The first sample of a hardware-timed acquisition with the NI 9211, NI 9217, and NI 9219 is acquired when the task is committed. This is represented by sample A in the above timing diagram. You can see that the 1st A/D conversion occurs prior to the start trigger. Sample A will repeat until a new point, B is acquired following the start trigger. Data is returned with each sample clock edge, while the A/D conversion will occur at the slower sampling rate of the module.

For example, if running an AI task at 1 kHz using a module with a maximum rate of 10 Hz, the slow module returns 100 samples of the first point, followed by 100 samples of the second point, etc. Other modules in the task will return 1,000 new data points per second, which is normal.

Software-timed acquisitions with the NI 9211, NI 9217, and NI 9219 always wait for a new sample to be acquired. When performing a single-point acquisition, no points are repeated.


Related Links:
Product Manuals: NI cDAQ-9172 User Guide and Specifications (June 2008)
Knowledgebase 493DGV0E: How do I Set the Sampling Rate of my NI-9219 Universal Analog Input Module in my Compact DAQ System?

Attachments:


Stale Sample.JPG - Stale Sample.JPG
Sample Clock Timing.JPG - Sample Clock Timing.JPG


Report Date: 04/24/2007
Last Updated: 01/15/2009
Document ID: 48NC2QAY

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit