- From: R Leao <richardson.leao_at_anu.edu.au>
- Date: Tue, 11 Jan 2005 19:32:32 +1100
I have a little program that reads from a comedi channel and writes to AO0 after some processing: comedi_data_read(device,subdevice,chan,range,aref,&datab); mv=100*(((float)datab/65536)*10-5); mv=-61.111; tauh=10000/(237*exp((mv+60)/12)+17*exp(-(mv+60)/25))+0.6; hinf=1/(1+exp((mv+76)/7)); h=hinf+(h-hinf)*exp(-0.1/tauh); ih=gih*h*(mv+45); counter=h; pdatab=datab; comedi_data_write(device,1,chan,0,aref,pdatab); rtf_put(FIFO, &counter, sizeof(counter)); rtf_put(FIFO, &mv, sizeof(mv)); rt_task_wait_period(); the program was working beautifully in a laptop with a NI DAQ6062 (kernel 2.4.27 - pentium m), but when I try to compile the same program in a desktop with a NI6036 (kernel 2.6.8.1 - pentium 4) there are lots of NaN's from the reading command but sometimes it picks the right value. Am I missing something? I have the following 'includes': #include <linux/module.h> #include <asm/io.h> #include <math.h> #include <rtai.h> #include <rtai_sched.h> #include <rtai_fifos.h> #define TICK_PERIOD 100000 #define TASK_PRIORITY 1 #define STACK_SIZE 10000 #define FIFO 0 #include "linux/comedi.h" #include "linux/comedilib.h" i also get lots of warnings while compiling: *** Warning: "rt_task_delete" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "rtf_destroy" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "stop_rt_timer" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "rt_task_make_periodic" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "rt_get_time" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "start_rt_timer" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "nano2count" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "rtf_create" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "rt_task_init" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "rt_set_periodic_mode" [/root/Comedi/Ih/myrt_process.ko] undefined!*** Warning: "rt_task_wait_period" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "rtf_put" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "comedi_data_write" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "comedi_data_read" [/root/Comedi/Ih/myrt_process.ko] undefined! *** Warning: "comedi_open" [/root/Comedi/Ih/myrt_process.ko] undefined! anyone has any idea why the program is not working in my desktop? I really appreciate any reply. Thanks heaps. richard
Received on 2005-01-11Z08:32:32