02-15-2006 06:41 AM
02-15-2006 09:52 AM
02-15-2006 10:32 AM
04-12-2006 04:04 PM
Hi Phil,
Sorry for the _very_ slow response. I missed your reply the first time.
Have you solved this problem yet?
Here is a little more information that may help in the future...
DAQmx maintains a "device position" in the output buffer that indicates the next sample that should be written to the device. This internal device position will always be slightly ahead of the actual sample being generated in the hardware because it is updated before the samples are transferred.
When you have regeneration enabled, DAQmx allows this device position to loop around to the beginning of the buffer and start generating "old" data without causing an error in your program.
When you use DAQmx Write to update the buffer during a regenerated AO operation, the DAQmx Write call does not affect the location of the device position. So, for instance, if you update the ENTIRE buffer with new samples, as soon as the DMA controller on the device fetches new samples from the buffer, the samples fetched will be the samples from your newly written waveform. There is some delay before the device starts generating the new samples because latency inherent in the DMA controller and in the AO FIFO. But the delay is NOT typically a whole buffer's worth of delay. So you should start seeing your new samples in the output relatively soon after writing them.
You can figure out the maximum delay caused by the AO FIFO by looking up the "depth" of the FIFO in the specs for the device. Some devices have a single sample FIFO (which causes no delay but limits the update rate). Other devices may have 512, 2048, or 4096 samples of depth in the FIFO. Just divide the number of samples in the FIFO by the sample rate to get the FIFO delay.
The delay caused by the DMA transfer is very system dependent so I can't be of too much help without going into a very in depth discussion here. If this delay is critical to your application, your best bet is to benchmark it by starting with a buffer filled with one value, update the entire buffer to a different value, and finally, update the entire buffer to the original value. You can use a scope to determine how long the new value shows up on the output terminal before reverting to the old value, or if you don't have a scope, you can time it with your device by routing back the output into a counter (try Measure Pulse Width).
Hope this helps,
Jonathan
04-03-2013 11:23 AM
Hi, what if I'm not generating waveforms but DC that need to be change every minute between two values? thanks in advance!