Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Read counter at well defined time intervals

Hardware : PCI-6224 & PCI-6723
Software : DAQmx & Labview


1) I connect an external device that generates TTL pulses to one of the board counters.

2) I want to know how many pulses were generated between 2 reads of the counter.

I can do that so far.


3) BUT it is very important to read the counter at a precise frequency, in other words with a hardware clock.

I tried to create a virtual channel using counter1 and the "DAQmx timing sample clock" with the card 20MHz timebase as the source to trigger every read of the counter. The read function is in a while loop.

But it doesn't work. I am stuck at this point.

Thanks for help.


0 Kudos
Message 1 of 2
(3,254 Views)
A simple solution is to put a pulse train out of one counter at some known frequency, the period on this pulse train will be time each TTL in will be integrated (counted) from.  Lets say this is 10KHz so each bin of TTL counts will be 100us.  On a second counter set the counter to count TTLs on the source pin corresponding to the TTL in line and have it count in buffered event counting mode from rising edge of the gate to rising edge of the gate.  Now you should set the out pfi of the pulse of the pulse train to the gate pfi of the buffered event counter.  You should be able to count events (TTL edges) on a well defined time period.  I have done this with a 6602 in both traditional and daqMX labview code.  One warning in daqMX mode the default is to filter out 0 events, so if there are times where no TTLs arrive on the source line, and this is a valid case, make this setting false.  I am not infront of LV right now so I cant give you any code or exact function names but hopefully you can follow the general architecture.  Good luck,
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 2
(3,223 Views)