Re: NI PCI-DIO-32HS and external triggering

Dear Andrew,

I am browsing through comedi's mailing lists archives and it looks like 
I have problems similar to those described in your e-mail. Did you 
manage to fix these problems, i.e. did you get the comedi_command to 
work? I saw no reply on the list.

Regards,

    Paco



ad_at_srl.caltech.edu wrote:

>I have installed comedi and comedilib and can do
>basic I/O with my NI PCI-DIO-32HS digital IO card
>(starting with the dio.c example program).
>
>Now I would like to use a TTL pulse applied to
>channel 0 to trigger some events in my main software
>program - I'm not actually interested in acquiring data
>from the IO card at this point...
>
>I started with the cmd.c example program and set up a
>command by hand as follows:
>
>int prepare_cmd(comedi_t *dev,int subdevice,comedi_cmd *cmd)
>{
>        memset(cmd,0,sizeof(*cmd));
>        cmd->flags = 0;
>        cmd->start_src =        TRIG_NOW;
>        cmd->start_arg =        0;
>        cmd->scan_begin_src =   TRIG_EXT;
>        cmd->scan_begin_arg =   0;
>        cmd->convert_src =      TRIG_NOW;
>        cmd->convert_arg =      0;              /* in ns */
>        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;
>        return 0;
>}
>
>comedi_cmd_test() is happy with this. However, it does not approve
>of TRIG_EXT being used for start_src. Anyways, I tried using the
>above with comedi_cmd(), but it does not appear to work - comedi_cmd
>returns immediately, regardless of whether I apply a TTL pulse to 
>channel 0 or not. I was expecting that comedi_cmd() would not return until
>I applied a single TTL pulse to the channel 0 input.
>
>Also, when I try reading the buffer (ala the cmd.c example), the read()
>hangs up.
>
>Also, I get "comedi_command: Device or resource busy" if I comment out
>the buffer read and try invoking comedi_command() a second time _ I'd
>like my program to respond to multiple triggers...
>
>Any ideas as to where I'm going wrong? I have not yet tried RT_LINUX,
>and I'd like to understand this problem before wading in...
>
>Thanks,
>Andrew
>
>
>
>  
>


-- 
With kind regards / Saludos cordiales

Paco López Dekker

paco.lopez_at_starlab.es, Starlab
Edifici de l'Observatori Fabra, Muntanya del Tibidabo
Cami de l'Observatori s/n, 08035 Barcelona Spain
Phone: + 34 93 254 0365, Fax +34 93 212 6445
Cellphone: +34 699 91 88 20
___________________________________________
Starlab, Living Science
http://starlab.es

This email is for the intended addressee only. If you 
have received it in error please return to sender and
do not distribute it.

Received on 2004-03-16Z18:00:33