config ni_660x.c for quad decoding, with counter support provided by ni_tio.c

Greetings,

I have an application where I need to read six quadrature encoders.  I 
am currently using an older version of ni_660x.c and my configuration 
looks something like the following:

lsampl_t config_data[4];
comedi_insn insn;
int i;

config_data[0] = INSN_CONFIG_GPCT_QUADRATURE_ENCODER;
config_data[1] = GPCT_X4;
config_data[2] = GPCT_IndexPhaseHighLow;
config_data[3] = GPCT_RESET_COUNTER_ON_INDEX;

insn.insn=INSN_CONFIG;
insn.n=0; // Irrelevant for config
insn.data=config_data;
insn.subdev=cnt.counter;
for(i=0; i<6; i++){
   insn.chanspec=CR_PACK(i,0,0);
   comedi_do_insn(cnt.dev, &insn);
}
			
The old method works fine, but I would like to update my comedi drivers 
to the most current version.  Does anyone have an encoder configuration 
example where they are using the new version of ni_660x.c that uses the 
ni_tio.c for counter support?

Many Thanks,
Greg

Received on 2007-03-16Z21:16:28