Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI-6220 COUNTER (Labview): Does "Sample Source" = "Gate Source"?

Hello,
 
I'm using Labview, DAQmx, PCI-6220 (Counter0).  I connected an incremental encoder signal to the source input of CTR0.  In Labview, the "DAQmx Timing" vi requires that the "source" input be wired.  Does this "source" actually mean the source of the sample clock vs. the "Source" input to the counter?
 
Thanks for your assistance,
Chris
0 Kudos
Message 1 of 4
(4,178 Views)

Chris,

When you talk about using a DAQmx Timing vi, I assume that you are performing buffered event counting or any other task that performs buffered acquistion.  You can see an example that performs buffered event counting in NI Example Finder called Count Digital Events Buffered - Continuous.  The DAQmx Timing vi in this example is used to read the current state of the counter into memory at a constant rate.  The source input of the Timing vi in this case means the source of the sample clock.  This clock is what determines when the counter state is read and stored into a buffer.


If you are performing event counting, and do not need buffered acquisition (no sample clock), you can look at example Count Digital Events.vi in Example Finder.  In this example no DAQmx timing vi is used.

Regards,

Jesse O.
Application Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 4
(4,161 Views)

Thanks Jesse.

I am attempting to synchronize a finite, buffered, event counting with an analog input task.  I have looked at the examples in Labview and I think I have a solution, but I'm not sure.  Is the following logic correct, please:

I have the output of an incremental encoder wired (hardware wired) to the counter source.  In Labview, I have the "source" on the timing vi set to be the ai sample clock.  My understanding is that the counter will be incremented each time an encoder pulse is present (on the counter's source input).  Then each ai sample_clk pusle will capture the ai channel and also the counter's current current "count" value (i.e. the number of encoder pulses between ai_sample clocks).

Thanks for your assistance,

Chris

0 Kudos
Message 3 of 4
(4,155 Views)

Chris,

You are correct if you have first configured and started an analog input task.  The sample clock from your AI read can be routed to a counter (internally by selecting the source to the timing vi).  On the edge of your sample clock, both your counter and analog channel will be read and stored in your buffer until you perform your DAQmx read for these two tasks.

Regards,

Jesse O.
Application Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 4 of 4
(4,139 Views)