Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I do a hardware triggered read of a counter?

Hello,
 
We are setting up a physics experiment to measure the speed of bullet using photogates and a data aquisition card.  The outputs of the photogates (there are 5 total) are converted into digital logic signals and combined into a single trigger line (using a NAND gate).  When the bullet passes a photogate I get a trigger pulse going into the digital trigger of my PCI-6024E DAQ.  My goal is to have clock pulses being counted by one of the internal counters and to read the clock whenever I get a trigger signal.
 
The timing is provided by the onboard clock of the DAQ.  The output of the clock is sent to the input of one of the counters which continuously counts the pulses.  This much I have working. I have attached the file below.
 
The thing I can't figure out (there are no examples that seem to fit this question) is how do I read the clock when I receive a trigger?  I will have ~5 seperate trigger instances (so I need retriggerability).  At each one of the triggers I want to read the count on the counter. Since I am looking at a bullet, software triggering is not really appropriate. Any suggestions?  Is there any simple modification to the program I have attached?  Thanks for any help you can provide.
 
Merce
0 Kudos
Message 1 of 3
(2,551 Views)

Hi Merce,

It sounds like you should look into Buffered Counting. Here is a great post on the subject: Highly accurate time stamping with a 6602. The same code should work for your board, though you will only have two counters availalbe to you and the highest clock available to you will be a 20MHz clock.

Hope this helps, please post back if this doesn't work for your application or you need more information.

Thanks,

Andrew S.

National Instruments

0 Kudos
Message 2 of 3
(2,535 Views)
The example was exactly what I needed.  Thanks!
Merce
0 Kudos
Message 3 of 3
(2,518 Views)