From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading position on each edge of sampling clock

Hello,
 
I'm using a counter on a usb-6259 to measure angular position from an encoder.
I need to read the position on both rising and falling edge of sample clock. Is this possible, because in the DAQmxCfgSampClkTiming function I have to choose between rising and falling edge ?
 
Thank you for your help.
Franck
0 Kudos
Message 1 of 3
(3,419 Views)
Hi Franck,
 
The driver manages two type of edge to acquire or generate samples: on rising or falling edge (xor if you prefer). So you cannot acquire on both edge.
 
Cordially,
0 Kudos
Message 2 of 3
(3,393 Views)

There *is* a potential workaround if the USB version of the card supports change detection on Port 0 of its digital inputs like the PCI version of the card.

You would set up a dummy continuous DI task using the "Change Detection" version of DAQmx Timing.  You'd have to specify which edges of which lines to detect changes on and also physically wire the signals of interest into digital lines on Port 0 of your card.  Finally, your counter task that measures the encoder would need to use an internal signal named something like "DevN/ChangeDetectEvent" as its sample clock.

I've used this kind of technique to sample various stuff in sync with encoder quadrature state change.  Here's a posted example that may help too.

-Kevin P.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 3 of 3
(3,386 Views)