LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog and Encoder being collected only on encoder pulses.

I would like, in the overall scheme of things, to be able to write data from analog and counter (encoder) channels to a file using the same sample rate for all of my data.  So all of my data would line up fine, if at all possible?

 

Thanks John,

 

vlee

0 Kudos
Message 11 of 12
(436 Views)

Hi vlee,

 

I think there should be a couple of options, let me just clarify one thing--do you need to measure the frequency of your encoder pulses, or would it be sufficient to simply return back the number of pulses that have occurred over a regular time interval? Depending on what information you need to return from the encoder, there are a few possible options.  Here are a couple that come to mind:

  1. You could measure the amount of pulses that have occurred at every tick of the AI Sample Clock (running total or reset at every clock edge).  From this you could figure out the frequency, but the accuracy of the measurement would not be as good unless the encoder is generating pulses quickly.  The benefit here is that the measurements would be exactly synched up with your AI task.
  2. You could continue to use a software-timed approach to retrieving your counter frequency measurement, just set a lower timeout value and handle the error accordingly.  If the measurement times out then we can say that the encoder is generating pulses at a rate slower than what the timeout allows.

Some of our newer DAQ devices (e.g. X Series) now support buffered, sample-clock timed counter measurements, but the cDAQ 9172 does not have this capability.

 

-John
John Passiak
0 Kudos
Message 12 of 12
(412 Views)