[prev in list] [next in list] [prev in thread] [next in thread] 

List:       comedi
Subject:    comedi commands inside RTAI fifo
From:       "Richard N Leao" <Richardson.Leao () anu ! edu ! au>
Date:       2005-09-27 4:47:57
Message-ID: 46226.150.203.7.225.1127796477.squirrel () sqmail ! anu ! edu ! au
[Download RAW message or body]

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.

richard



-- 
Richard N Leao, MD PhD,
Neuroscience Division,
JCSMR, ANU


_______________________________________________
comedi mailing list
comedi@comedi.org
https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic