I use Comedi 0.7.60 and rtlinux 3.1 (linux 2.4.4), and I have PIC-6024E
board.
I tried to use the following:
-------------------------------------------
#include <time.h>
#include <pthread.h>
#include <linux/comedilib.h>
pthread_t thread;
void * start_routine(void *arg)
{
lsampl_t data;
pthread_make_periodic_np (pthread_self(), gethrtime(), 500000000);
while (1) {
pthread_wait_np ();
if(comedi_data_read(0,0,0,0,AREF_DIFF,&data)<0)
rtl_printf("error\n");
else
rtl_printf("ho letto %d\n",(int)data);
}
return 0;
}
int init_module(void) {
int subdv,i,nchan,type;
if(comedi_open(0)<0)
rtl_printf("non apro\n");
return pthread_create (&thread, NULL, start_routine, 0);
}
void cleanup_module(void) {
comedi_close(0);
pthread_delete_np (thread);
}
----------------------------------------
during the execution the following error occurs during
comedi_data_read():
ni_E: timeout 2
sometimes I obtain a different one:
ni_E: timeout 1
I wonder if there is an error in the code or if the board is broken.
thanks and sorry for my english
--
Massimiliano Cialdi
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/