03-21-2008 05:56 AM - edited 03-21-2008 06:04 AM
03-26-2008 12:22 PM
Hi atrac,
your code is correct, the matter is that the usb6259 (an M-series board) does not support the Digital Pattern Start trigger feature. The only board family, programmable with DAQmx APIs, that is able to accept a digital pattern as start trigger is the 653x; these boards are part of NI HSDIO (High Speed Digital I/O) products.
Let me know if you have other questions,
Best regards,
Fabio
03-27-2008 09:30 AM
03-27-2008 10:28 AM
03-28-2008 03:14 AM
Thanks for your answers.
I try to explain the application a bit more. I need to acquire 24-bit words at a rate of 800kHz, with an external clock connected to PFI0. I also have to do a little processing: synchronize on a digital pattern (that occurs every 64 samples), discard some selected words after the pattern, and dump the remaining data to disk. Essentially, a it is a software down-sampling.
Initially, I wrote a trivial test program that successfully reads data from the board (and discards those data) at the desired rate, using the callback registered by DAQmxRegisterEveryNSamplesEvent. With successfully I mean that I do not get any buffer overflow.
But, if in the callback I insert a to call fwrite to dump those data to the disk, it seems that the writing to disk (in blocks of nSamples, see below) cannot follow that rate. The timing is very critical and in some conditions I get buffer overflow. The problem seems to be choosing the right combination of buffer size (i.e. number of samples in DAQmxCfgSampClkTiming) and number of nSamples (how many samples in buffer to trigger DAQmxRegisterEveryNSamplesEvent). At this time, I found the best compromise without having too large buffers using buffer size = 8MB and nSamples = (buffer size)/10. But this was set by attempt. What is the rule? What do you suggest? Is it a problem of windows xp latency when accessing the disk? The disk is in DMA mode, and I would expect it to be much faster than the usb bus!
This board has a very small hardware fifo (2047 samples), but is rated at more than 1MS/s, so it should do the job. What is your opinion?
Thank you