Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Spiking of AI signal that correlates to BeginReadMultiSample period

First off, I have a .NET application running with MeasurementStudio 8.0.1 and NI-6225 boards to read some channels. There are 5 channels total running at 100 Hz each and I'm using a AnalogMultiChannelReader set up for Continuous sampling.  I'm using reader.BeginReadMultiSample() to start the asynchronous reads with a sample size of 50 samples.  My understanding is that once the task is started the hardware is continuously sampling to a buffer and this asychronous callback is responsible for pulling data from the buffer.
 
The part I do not understand is that I'm seeing some spikes in my data that correlate to the period of my asynchronous callback.  In other words, at data point 0, 50, 100...there's a noticeable spike in the data.  When I change the period, ie change the sample size of the BeginReadMultiSample() to 100, the spike realigns itself to the new period (0, 100, 200).
 
This makes no sense to me since I believe the act of continuous sampling to be just that...continuous, and independant of the "post processing" of data in the asychronous callback.
 
Any thoughts here?  I'm running out of them...
 
Steve
0 Kudos
Message 1 of 3
(2,814 Views)

Hi SVC-Steve

What language are you using to write your application?

What are you trying to measure? How large are the spikes you are experiencing?

Have you looked at some of our shipping example codes for continuous data acquisition? These are often good starting points for people who want to use callback functions in DAQmx. The one in particular we should look at is the one under C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog Out\Generate Voltage\ContGenVoltageWfm_IntClk\

Could you also post a snippet of code showing how you are calling the callback function as well as the code for its definition?

 

S_Hong
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(2,801 Views)

My fault...as you may have guessed the problem was in our callback code that is analyzing the data.  The data I was plotting was an average from the start of the read instead raw values.  This made the first points spike because they contain unaveraged noise but as you approach the last point of the set it's averaged out.

Sorry for any inconvenience.

0 Kudos
Message 3 of 3
(2,782 Views)