Update on continuous aquisitions

I switched cards today from the at-mio-16e-2 to an at-mio-16e-1.   The 
new card exhibited a similar problem but shed a little bit more light on 
the problem.  The new card has a 8192 sample buffer instead of the 
previous card's 2048 sample buffer.  It only aquired for 16384 calls to 
read(comedi_fileno(dev),(void *)data,8192) compared to the previous 
card's 65536.  This meant to me that its not the number of calls to 
read() that causes the problem but instead the problem occurs after 
2^27  bytes have been transferred from the card (ie: after 2^26 samples 
[at 2 bytes/sample]).  The scan counter on the board is only 24 bits and 
a look at the driver code leads me to believe that the continuous 
aquisition bit on the card is being set.  This seems not to sugguest 
that the on-board scan counter is simply stopping the card. 

The loop in my code executing during aquistion is this:
while(1)
     {
       m=read(comedi_fileno(dev),(void *)data,8192);
       //fwrite((void *)data,2,m/2,datafile);
       if(m<0)
         {
       perror("write");
       exit(0);
         }
       printf("m=%d sample=%d\n",m,(short)data[0] );
     }

The symptoms of the bug are the the message "m=8192 sample=XXXX" appears 
16384 times at regular intervals and then just doesn't appear again.  
The program does not terminate, there are no errors and the syslog is 
silent.  This leads me to believe that the read call is blocking.  I'm 
not sure why this is happening.

I'm continuing to plow through the code looking and trying to understand 
whats going on.  I was hoping that perhaps this might shed a little more 
light on the problem in someone's mind who knows more than me.

Thanks,
David Carr

Received on 2004-04-03Z19:46:05