Re: RTAI and Comedi: Problems with commands

I'm not expert with COMEDI programming, but you can get as example the code 
implemented in the "sfun_comedi_data_read.c" that you can find in rtai-lab 
directory. This is a S-Function written to read data from a COMEDI device.

Roberto

On Monday 06 November 2006 17:04, M. Koehrer wrote:
> Hi everybody
>
> I have scanned through all the comedi sources and I have one question
> concerning the issue I have asked before:
> When I understand the command things right, the analog in data is
> transferred via DMA to the async->prealloc_buf.
> I found out that the data will be written to prealloc_buf.
> My question is now: Where in the comedi code is the data transferred from
> prealloc_buf to the user address space?
> In "standard" (non realtime) comedi this is happens in comedi_fops.c
> (function comedi_read). I have not found a corresponding code that can do
> this for RTAI LXRT.
>
> Thanks a lot
>
> Mathias
>
> > On Monday 06 November 2006 13:14, M. Koehrer wrote:
> > > Hi everybody,
> > >
> > > I am trying to use the comedi commands using RTAI (RTAI 3.3CV, latest
> > > comedi/comedilib). On the RTAI CVS I have found an (old?) example
> > > testa.c that I used as base. (see attached testa.c).
> > > The program testa sets up a command to sample from the first AIN
> > > channel a couple of times.
> > > The test compiles and runs (10 lines are printed out), however the data
> > > value is always 0.
> > > I have debugged into the driver (I use a simple PCI NI 6024-E) and I
> >
> > found
> >
> > > out that the data is transferred correctly via DMA to the async
> > > prealloc_buf. It seams as the only thing that misses is the transfer
> > > from the internal (kernel space) memory that holds the input values
> > > (written
> >
> > by
> >
> > > DMA) to the user space value.
> > >
> > > One strange thing that I have detected was the following:
> > > The function rt_comedi_alloc_cmd() sets internally the values of
> >
> > cmd->data
> >
> > > and cmd->chanlist and returns the values in the arguments **chanlist
> > > and **data. However, when testa returns from comedi_command_test() the
> > > value
> >
> > of
> >
> > > cmd->data has changed - it points now somewhere in a 0xexxxxxxx address
> > > space. Could this be an issue?
> > >
> > > Is there somewhere a running example available that shows working
> > > comedi commands with RTAI?
> > >
> > > Thanks for any help on this issue.
> > >
> > > Mathias
> >
> > --

-- 
University of Applied Sciences of Southern Switzerland
Dept. Innovative Technologies
CH-6928 Lugano-Manno
http://www.dti.supsi.ch/~bucher

Received on 2006-11-06Z17:24:09