ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error use quadrature encoder to count optical mouse position

Hello, PRO
Can U explain me how count pulses from optical mouse? I have 2
quadrature signals (as said in document about Quadrature measure in Edevices
I connected XA to PFI8/GPCTR0_source, XB - DIO6...and digital ground to the
DGND).
I used sample "STCcountWithHWDirControl.C" to count pulses. This sample
was developed for device with DAQ-STC counting/timer... 🙂
But result of counting = 0. Where is mistake?

One detail (maybe it help): I connected XA to analog input and read values. This pulse had 0.1volt amplitude , but when I measure voltage between XA and DGND by a oscilloscope. It was 5V.

Sincerely
Spivot

P.S.
NI Software : Measurement Studio for Visual C++ version VC++ with NI-DA
Q 6.9.1
NI Hardware : Multifunction DAQ device DAQPAD-6020E
0 Kudos
Message 1 of 2
(2,840 Views)
Hello;

The first thing you should test is if the pulses can be counted at all by the general purpose counters of your device. The way to go about that is to connect the pulse to the source of one of the counters and run the simpleeventcount.c example.

If even that example doesn't work, you will need to condition the pulses before going to the counter.

Hope this helps.
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,840 Views)