Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous timestamping and rate monitoring?

Hi, I am using a PCI-6229 multifunction DAQ card to assign time stamps to two signals (generated by an external instrument), each consisting of a train of TTL pulses with random between pulses. I am using the 80 MHz time base as the source for each of my two counters and I have the two signals going into the counter gates. This is all working fine. What I need to do is simultaneously get the number of counts registered in a particular time interval, say the last 10 ms or 1 ms. i.e. I would like a live display telling me how many pulses my counters picked up in the last 10 (or 1) ms. Is there any way to do this without requiring more counters (since I only have the two)? I've tried having software time the 1 or 10 ms intervals but this does not seem to be acurate enough. Any ideas?

Thanks!
0 Kudos
Message 1 of 3
(3,878 Views)
I have a nagging feeling there's a simpler way, but here's one possible approach:
 
You're going to need to accumulate your timestamping measurements in memory somewhere to support some near-real-time post processing.  Each time you read timestamps from the task buffers, add them to some kind of accumulating storage (shift register, queue, etc).  Read the last element (the latest timestamp), and then search the data for to find the timestamp that comes 10 msec earlier.  The built-in function Threshold 1D Array should work for this since the timestamps will increase monotonically.  Now, the difference in indices tells you the # of incoming pulses in that 10 msec.
 
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 3
(3,868 Views)
Thanks, I tried implementing something like that and it worked fine when I sent a steady stream of pulses into my counters (fixed frequency). But when I hooked up my detectors which put out a random (poisson distributed waiting times between pulses) pulse train the program ran for a few seconds and then each channel stopped recording and I got a 200141 error message. Apparently I have the same problem as in this thread

http://forums.ni.com/ni/board/message?board.id=40&message.id=4734&query.id=11657#M4734

unfortunately it seems that I need to upgrade my hardware to get around this issue. Thanks for the help!
0 Kudos
Message 3 of 3
(3,849 Views)