Re: Exmples using two cards

On Fri, 26 Sep 2003, David wrote:

> Hi all.
>
> I'm looking for an example of data adquisition using comedi_cmd with two
> differents cards at the same time.
> I have tried to define an array
>
> comedi_t *comedittt[2];

 It works for me, I am using two NI DIO-32HS cards, in our experiment,
 since two years and it is working also now.
 Probably the problem is coming that in C when you declare:
 comedi_t *comedittt[2];
 (means when you declare a pointer) the C language will always reserve
 4 bytes (not more) and the segmentation fault is du that you access a non
 declared meemory . try to declare non-pointer and give to comedi_open a
 pointer or reserve memory with malloc().
 I am not sure it is the case .

>
> and then use the same functions when i have only one card in a loop (for)
>
> comedittt[i] = comedi_open ( ...)
>
> Comedi_open seems to work fine, but the first time i use
> comedi_find_subdevice_by_type (comedittt[i], ...)
> a segmentation fault freeze my machine.
>
> Can anybody help me?
>
> Thanks in advance
>
> Daniel
>
>
> -- Daniel Machón [damachon_at_eresmas.net] --
>
>
> _______________________________________________
> comedi mailing list
> comedi_at_comedi.org
> https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi
>

Received on 2003-09-26Z14:41:59