- From: Andrés Cascallana Alvarez <acascallana_at_simulare.es>
- Date: Wed, 11 Feb 2004 10:22:56 +0100
Hello,
Thank you very much Joerg for the information. I've copied the code in the
ni_mio_common.c file, and it works, but i've found at least two problems:
1) The data is tried to be copied when you invoke a comedi command from user
space, which leads to a kernel panic. This can be easily fixed by asigning a
NULL to the cmd.data field and testing that in ni_mio_common.c before
performing the copy.
2) comedi.data[n] doesn't match channel n any more. Depending of the number
of channels adquired, the data on channel 0 could be in different positions
on the buffer.
I'll try to have a look at the source code now that i have a starting point.
Thank you very much again.
Regards,
Andres
> Message: 3
> Date: Mon, 09 Feb 2004 12:55:22 -0100
> From: =?ISO-8859-1?Q?J=F6rg_Biedermann?= <biedi_at_sbox.tugraz.at>
> To: acascallana_at_simulare.es, comedi_at_comedi.org
> Subject: Comedi callback problem using NI_PCIMIO driver
>
> Hello,
>
> My name is Joerg Biedermann and i also don't have much experience using=20
> comedi. I ran into the same problem like you. I am using comedi-0.7.67,=20
> comedilib 0.7.21 and RTAI 24.1.12 and a NI-6024E DAQCard.
>
> I've also registered my callback function using
> comedi_register_callback, and it was called, but the data was not
> placed on the buffer pointed by the cmd.data structure. So I examined=20
> the source code of the driver (ni_mio_common.c and ni_mio_cs.c) and=20
> found out, that there is some code missing, which transports the
sampled=20
> values in the cmd.data structure. So i added those lines in the=20
> ni_mio_common.c:
>
> static void handle_a_interrupt(comedi_device *dev,unsigned short status,
> unsigned int m_status) {
>
> comedi_subdevice *s=3Ddev->subdevices+0;
> comedi_async *async =3D s->async;
> comedi_cmd cmd =3D async->cmd;
> unsigned short ack=3D0;
> sampl_t *joedata =3D cmd.data;
> unsigned int chanlen =3D cmd.chanlist_len;
> int k;
>
> .......
> .......
> .......
> if(devpriv->aimode=3D=3DAIMODE_SCAN && status&AI_STOP_St){
> =09
> ni_handle_fifo_dregs(dev);
> =09
> for(k=3D0; k < chanlen; k++) {
> comedi_buf_get(s->async, &joedata[k]);
> }
> .......
> .......
>
> I don't know if this is the most elegant way, but it seems to work.
Received on 2004-02-11Z09:22:56