LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffered Event Counting of Angle Encoder motion

Hi,

We are going to use a quad angle encoder to act as a sampling clock for 6 Analog Inputs. Basicly, everytime the angle encoder produces a pulse due to rotation we want to sample the 6 Analog Inputs.

The board we're using is a PXI-6259 M.

We want to connect the quad angle encoder to one of the NIDAQmx counters to enable us to determine angular position.

We want to use the other NIDAQmx counter as a buffered event counter with a NIDAQmx timing signal connected to the SOURCE and the output from the other counter connected to the GATE. This will enable us to timestamp encoder pulses as well as use encoder pulses as the sampling clock.

Thats the theory, but can it be done ? I'm confused as to how we route the encoder counter output to the GATE of the buffered event counter....any idea ? Also, what suitable timing signal should we route to the SOURCE of the buffered event counter and how shoudl we route it ?

Any help on this would be greatly appreciated.

Cheers, Shaun.
0 Kudos
Message 1 of 2
(2,816 Views)
I'll answer my own question for the sake of anyone else who may have a similar question one day.

Timestamps
We simply route the encoder signal to a counter and configure it to be a Bufered Event Counter via the DAQmxCreateCICountEdgesChan function. If
we now route and internal timebase, say the 20MHz clock, to the counter Source via the DAQmxCfgSampClkTiming function, we can count timebase pulses between encoder pulses and thus timestamp ecoder motion.

Encoder Position
We simply connect the quad encoder to the other counter as standard using the DAQmxCreateCIAngEncoderChan function

Position Sampling

We route the same encoder signal to the external scan clock and then use that as the sampling clock for the 6 Analog Inputs

An alternative solution for position sampling, and perhapps a little more elegant, would be to connect the encoder signal to digital port 0, configure it for change detection and then use the
ChangeDetectionEvent as the samping clock for both the encoder and the 6 Analog Inputs.

Cheers, Shaun.

0 Kudos
Message 2 of 2
(2,782 Views)