NI_PCIMIO : callback function is not called at expected frequency in kernel space

Hello list,

I have been trying to get a callback function called at the end of scans
in kernel space. However, I found that the function was not called at
the expected frequency. I wish anyone could help.
I am using comedi-0.7.70 installed under RTAI-3.1. The device I used for
the test was NI's PCI6071E. It is not sharing the IRQ with other
devices. With its max sampling frequency of 1.25MHz, the minimum
interval between each conversion should be 800nsec. Therefore, I entered
the sampling parameters as below:

comedi_cmd cmd;

cmd.convert_arg = 800; // <-------- minimum interval
cmd.convert_src = TRIG_TIMER;

cmd.subdev = 0;
cmd.flags = TRIG_WAKE_EOS;
cmd.start_src = TRIG_NOW;
cmd.start_arg = 0;
cmd.scan_begin_src = TRIG_TIMER;
cmd.scan_begin_arg = 0;
cmd.scan_end_src = TRIG_COUNT;
cmd.scan_end_arg = 4;
cmd.stop_src = TRIG_COUNT;
cmd.stop_arg = 100; // <-------- 100 scans

Call to comedi_command with the above parameters returned 0 (No error).
However, I found that the callback function was called only for 20
times. It was not until I increased command.arg up to 8000 when the
callback was called for 100 times. I made sure that the ni_pcimio driver
performed 100 scans as specified (comedi_get_buffer_contents returned
800bytes = sizeof(sample_t) X 4 channels X 100 scans) even with the
800nsec conversion interval. Looks like that some of the end_of_scan
events are discarded when the conversion interval is short. Is that correct?
Thanks in advance.

Yoshiya Matsuzaka

Received on 2007-05-22Z05:36:01