Re: INSN_INTTRIG for comedi command

Hi again,
       I got the instruction to send properly, using n=1.  However read 
still returns a zero and I get no data.  I have it set up so comedi_command 
is called first, and then the instruction is sent to start acquisition, and 
then the for loop which does the reading.  Is that right?  I also tried 
doing using comedi_poll after the instruction is sent but before the read, 
but it returns -1.

Justin

At 03:44 PM 6/5/2003 -0400, Justin Osborn wrote:
>Hi all,
>        I'm working on getting data from a device connected to a NIDAQ 
> card using Comedi.  I'm modifying cmd.c in the demos to suit my 
> purposes.  I'm using the ni_pcmio driver.  I got cmd.c working with 
> subdevice 0, but the data is supposed to be coming over subdevice 
> 1.  Subdevice 1 (according to the info demo program), has to have 
> TRIG_INT for the start_src, which means I am supposed to send a 
> INSN_INTTRIG.  I set up the comedi_cmd, and comedi_command_test is 
> successful.  I've then tried to set up a comedi_insn (with insn set to 
> INSN_INTTRIG) in order to start the thing going, but comedi_do_insn 
> always returns -1.  I have the comedi_do_insn after the comedi_command 
> call, but before the read() for loop.  I'm wondering how the comedi_insn 
> should be formatted for an INSN_INTTRIG.  There's not much documentation 
> on instructions, only a few simple examples of how to set up instructions 
> in insn.c.
>
>I have tried it this way
>
>starter comedi_insn;
>
>starter.insn=INSN_INTTRIG;
>starter.n= (tried a number of different things here)
>starter.data=(tried using an actual buffer)
>starter.subdev=1;
>starter.chanspec=CR_PACK(channel, range, aref); (those values are already 
>set up earlier in cmd.c)
>
>I didn't think anything besides insn and subdev really mattered because 
>you're just giving it a command to start acquiring data, and the data 
>should be read back through read, not through the instruction.
>
>Anybody know how to do this?  Sorry for not sending the code, the machine 
>I'm writing it on isn't on the network.
>
>Thanks,
>Justin
>
>
>_______________________________________________
>comedi mailing list
>comedi_at_comedi.org
>https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi

Received on 2003-06-06Z14:15:54