04-26-2010 04:22 PM
Using a PCI-6221, calling into the DAQmx 8.6 DLL with a standalone C application.
I create and populate a buffer like so:
float64 volts1[2048];
for(int x = 0; x < 2048; x++) {
volts1[x] = (-0.320) + (x * (0.640 / 2048));
}
My task is created and started as follows:
TaskHandle t;
DAQmxCreateTask("WaveTask", &t);
DAQmxCreateAOVoltageChan(t, "PCI-6221/ao0", NULL, -5, 5, DAQmx_Val_Volts, NULL);
DAQmxCfgSampClkTiming(t, NULL, 30000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 2048);
DAQmxWriteAnalogF64(t, 2048, false, -1, DAQmx_Val_GroupByScanNumber, volts1, NULL, NULL);
DAQmxStartTask(t);
DAQmxWaitUntilTaskDone(t, -1);
DAQmxStopTask(t);
DAQmxClearTask(t);
The above, minus creating and clearing the task, is executed in an endless loop. It generates a very lovely approximation of a rising sawtooth wave (see attached complete.png).
Unfortunately, when you zoom in on the time axis, a glitch becomes apparent at the point where the waveform crosses zero (see glitch.png). The glitch, as shown, is about 80 mV in amplitude and 2.5 us (microseconds) in duration.
It's extremely short, but could be the source of trouble. Is there anything that can be done programmatically to correct this, or does it look like a hardware issue?
Many thanks!
~Brian
Solved! Go to Solution.
04-26-2010 05:33 PM
If you check out the specifications for the PCI-6221, you'll see that there is a specification on page 3 for glitch energy on the analog output of this board. This is a result of the DAC on the board and isn't something that can be corrected in software. The specification is:
So what you are seeing is under the specification, so your board is actually performing better than spec.
Hope this clarifies,
04-27-2010 08:38 AM
04-27-2010 09:19 AM
Yeah, that one takes a bit to understand. It's even more fun given that glitch energy is sometimes specced in terms of V/nS or something similar, so that you then have to know that you have to multiply the peak of the spike by the duration of the spike.
DAQ hardware specifications can be complex some times, so feel free to post here any time anything is unclear, we are here to clear them up.
Best of luck with your application,