01-24-2006 12:05 PM
01-24-2006 01:30 PM
Yeah it is. I'm guessing there's a coding error somewhere, but I can't find it
I believe the error number is 200141 (it was that for a different version of the software) but I'll check again this afternoon
Thanks for all the help. I've attached the file
Nice Icon, by the way. There's no such thing as mysterious
01-24-2006 05:11 PM
01-24-2006 06:36 PM
01-25-2006 12:15 PM
The slowdown is likely is due to the file writing. I don't have much experience with writing data to file so you may be better off keeping the separate loops. Let me know how the wait until next ms goes.
Good luck!
gus....
01-30-2006 01:24 PM
01-30-2006 02:12 PM
02-03-2006 05:01 PM
02-06-2006 07:40 PM
02-07-2006 08:25 AM
Ryan made a suggestion about binning. There've been quite a few photon detector threads here the last year or two, and binning seems to be the most typical approach.
The code you posted is different than that. It's designed to perform precise time-stamping of every single incoming photodetector pulse. The count value is incremented at 80 MHz. while each photon pulse causes the instantaneous count value to be buffered. For high pulse rates or long durations, your system may have trouble keeping up due to the board's small FIFO and the shared PCI bus. I haven't done a lot of testing recently, but I'd anticipate trouble as pulse rates get up toward >100 kHz for >1 sec or >500 kHz for any amount of time. Again, the code you posted uses the photon pulses like a sampling clock, producing an unpredictably variable sampling rate.
Most of the people who've wanted to measure photon rates have taken a different approach - binning. In this approach, the count value is incremented by each photon pulse but the buffering rate is throttled down to a constant sampling rate the system can maintain -- say 10 kHz for example. The simplest measurement is just to let the count value accumulate throughout the measurement time. You can simply subtract adjacent elements to determine # of pulses per 0.1 msec bin, giving you an average pulse rate during each 0.1 msec interval.
Odds are that when you timestamp individual photon pulses, the rate will be quite variable benefit from averaging anyway. May as well let the hw do it.
If you go with binning, the other two things to watch for (some info can be found on the forums here) are "Duplicate Count Prevention" and counter rollover (aka terminal count or TC).
-Kevin P.