Showing results for 
Search instead for 
Did you mean: 

Reading position on each edge of sampling clock

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.
0 Kudos
Message 1 of 3
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.
0 Kudos
Message 2 of 3

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?
0 Kudos
Message 3 of 3