- From: Caleb Tennis <caleb_at_aei-tech.com>
- Date: Mon, 28 Oct 2002 14:03:09 +0000
Yep, I use insn's: lsampl_t op[2]; comedi_insn insn; insn.insn = INSN_CONFIG; op[0] = GPCT_RESET; then op[0] = GPCT_SET_SOURCE; op[1] = GPCT_INT_CLOCK; then op[0] = GPCT_SET_GATE; op[1] = GPCT_EXT_PIN; then op[0] = GPCT_SET_DIRECTION; op[1] = GPCT_UP; then op[0] = GPCT_SET_OPERATION; op[1] = GPCT_SINGLE_PERIOD; insn.data = op; insn.subdev =4; insn.chanspec=CR_PACK(0,0,0) (or (1,0,0) for the 2nd GPCT) insn.n = # of instructions (1 or 2) comedi_do_insn(mvpMod, &insn); Then, every once in a while do a comedi_data_read(mod,4,0,0,0,&val) and your internal counter will be stored in val. It increments for every "up" pulse seen on the line. Hope that helps. Caleb On Monday 28 October 2002 06:08 pm, Lucas Watkins wrote: > I got my PCI-6052e working, but now I've got another issue. I need to > count TTL signals coming into the board, and I'm not really sure how to do > it. If I do streaming input on analog in, the time resolution isn't quite > good enough to always catch the pulse. And command isn't supported on > channel 4, which, according to info, is a counter, but only has values 0 > and 1.
Received on 2002-10-28Z14:03:09