- From: Justin Osborn <josborn_at_cme.nist.gov>
- Date: Thu, 05 Jun 2003 15:44:04 -0400
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
Received on 2003-06-05Z18:44:04