Re: NI PCI-6221 encoder (Was: JR3 force sensor driver)

Frank Mori Hess wrote:
> On Thursday 21 June 2007 13:36, you wrote:
>> I know (I'll get to it as soon as I have figured out how to use the NI
>> pci-6221 with quadrature encoders).
> 
> See the enums in comedi.h, in particular enum ni_gpct_mode_bits.  You'll 
> need to use one of the NI_GPCT_COUNTING_MODE_QUADRATURE_XN_BITS bitfields, 
> instead of the NI_GPCT_COUNTING_MODE_NORMAL_BITS that the simple counting 
> demo uses.  And maybe some of the NI_GPCT_INDEX_* bits.  It might actually 
> be useful to look at the ni 6601/6602 register level programming manual.
That only partially works, what happens is that whatever
NI_GPCT_COUNTING_MODE_QUADRATURE_XN_BITS is selected, the counter starts to
count down on each edge on CTR{0/1}A (PFI 8/PFI 3) but remains stationary
regardless of activity on CTR{0/1}B (PFI 10/PFI 11). To me this indicates that
the counter is not in encoder mode, because a failure in the routing of the B
signal should result in the counter changing one value only (X0 -> X1 -> X0
transitions should gige one up and one down event). Direction is changed if
NI_GPCT_COUNTING_DIRECTION_UP_BITS is set.

Where can I find the documentation where M_Offset_G0_Counting_Mode, etc are
found (the only document I have found on NI's site is "NI M Series Register Map
(Preliminay)"

Regards

Anders Blomdell

-- 
Anders Blomdell                  Email: anders.blomdell_at_control.lth.se
Department of Automatic Control
Lund University                  Phone:    +46 46 222 4625
P.O. Box 118                     Fax:      +46 46 138118
SE-221 00 Lund, Sweden

Received on 2007-06-25Z08:57:34