- From: Klaas Gadeyne <klaas.gadeyne_at_fmtc.be>
- Date: Thu, 15 Feb 2007 09:55:37 +0100 (CET)
On Wed, 14 Feb 2007, Jordi Blanch Carles wrote: > Hi all. > > We are using a NI 6601 to count encoder pulses. We have configured > the counter 0 as a quadrature encoder with X4 mode and counter reset on > index. All works well, but on index pulse there is no reset of the > counter. > > Does anybody know something about this problem? I don't think I ever tested that part of the functionality. Can you show the relevant lines of code where you configure the counter? I'd suspect something like insn[1].insn=INSN_CONFIG; insn[1].n=0; // Irrelevant for config config_data[0] = INSN_CONFIG_GPCT_QUADRATURE_ENCODER; [...] config_data[3] = GPCT_RESET_COUNTER_ON_INDEX; [...] Which should (according to a quick glimpse in the code (ni_660x_GPCT_insn_config) result in setting the index_mode bit in the counting mode register ( see the ref manual on pages 3.21/22 ). It states (when in quadrature mode) <quote> The Z input signal, or index, can reload the counter in a particular phase. The counter reloads when this bit is set, A and B match the index phase, and the Z input in high </quote> I don't know what they mean with "A and B match the index phase", but maybe that's the problem... ps. Note that Frank (completely) rewrote the the counter code recently, so I guess you're not using the latest anoncvs? regards, Klaas
Received on 2007-02-15Z08:55:37