Commedi command inside RTAI fifo
R Leao
richardson.leao at anu.edu.au
Wed Sep 28 09:58:19 CEST 2005
Hi All,
I want to do a single sample scan through 8 channels of my DAQ board and
I want it to be repeated through a FIFO in an RTAI module. I need it to
be looped because I want to do a real time window discriminator (based
on the amplitude of the signal in each input). The RTAI module peace of
code
looks like this:
> > >
> > > static void fun(int t)
> > > {
> > > char buf[N_CHANS];
> > > for(i=0;i<n_chan;i++){
> > > chanlist[i]=CR_PACK(chan+i,range,aref);
> > > }
> > > cmd->chanlist = chanlist;
> > > cmd->chanlist_len = n_chan;
> > >
> > > cmd->scan_end_arg = n_chan;
> > > if(cmd->stop_src==TRIG_COUNT)cmd->stop_arg = n_scan;
> > >
> > > /* the subdevice that the command is sent to */
> > > cmd->subdev = subdevice;
> > > /* flags */
> > > cmd->flags = 0;
> > > cmd->start_src = TRIG_NOW;
> > > cmd->start_arg = 0;
> > > cmd->scan_begin_src = TRIG_TIMER;
> > > cmd->scan_begin_arg = (int)(1e9/freq);
> > > cmd->scan_end_src = TRIG_COUNT;
> > > cmd->scan_end_arg = n_chan; /* number of channels */
> > > cmd->stop_src = TRIG_COUNT;
> > > cmd->stop_arg = n_scan;
> > > cmd->chanlist = chanlist;
> > > cmd->chanlist_len = n_chan;
> > > ret = comedi_command_test(device,cmd);
> > >
> > > while (1) {
> > > ret=comedi_command(device,cmd);
> > > ret=read(comedi_fileno(device),buf,N_CHANS);
> > > counter=data[2];
> > > pdatab=2;
> > >
> > > rtf_put(FIFO, &ret, sizeof(ret));
> > > rtf_put(FIFO, &pdatab, sizeof(pdatab));
> > > rt_task_wait_period();
> > > }
> > > }
> > >
> > >
It compiles OK but when I try to run, it says:
> > > insmod: error inserting 'myrt_process.ko': -1 Unknown symbol in
module
> > > ERROR: cannot load myrt_process.ko
> > >
> > > I have the following relevant modules loaded:
> > >
> > > Module Size Used by
> > > ni_pcimio 48768 0
> > > mite 6148 1 ni_pcimio
> > > comedi_rt_timer 7424 0
> > > comedi_fc 3072 2 ni_pcimio,comedi_rt_timer
> > > 8255 5248 1 ni_pcimio
> > > kcomedilib 12544 1 comedi_rt_timer
> > > comedi 31488 5
> > > ni_pcimio,comedi_rt_timer,comedi_fc,8255,kcomedilib
> > > rtai_shm 9600 0
> > > rtai_fifos 38220 0
> > > rtai_lxrt 72880 5
> > > ni_pcimio,comedi_rt_timer,kcomedilib,rtai_shm,rtai_fifos
> > > rtai_math 27780 0
> > > rtai_up 53776 0
> > > rtai_hal 21364 6
> > > ni_pcimio,kcomedilib,comedi,rtai_fifos,rtai_lxrt,rtai_up
> > >
> > >
> > > Am I missing any module to be loaded if I use the comedi command?
This
> > > little module works fine if I use 'comedi_data_read'. Thanks all.
dmesg says that:
myrtprocess: unkown symbol read
Any help would be extremely appreciated.
Thank you!
--
R Leao <richardson.leao at anu.edu.au>
JCSMR, Australian National University
More information about the Rtai
mailing list