04-03-2015 02:30 PM
Sure, I made very slight mods to the originally posted snippet. The whole purpose of the 2nd (upper) counter task was to generate a clock whose periods would be measured. You don't need that as you can use the Laser On/Off signal.
Note: in this setup, photons are counted all the time whether the laser is on or off. At the end of every rising edge interval, the instantaneous count is buffered and then the count is reset back to 0. If it's important to count *only* during the laser's on time, you could change this to a semi-period measurement. That would buffer and reset counts on both edges. You'd end up ignoring half that data and you'll have to be careful about polarity to be sure you know which half to keep, but it gives you a method to get hardware-accurate APD counts only while the laser is on.
-Kevin P
04-07-2015 02:54 AM
I'm back from my Easter day. Thank you very much Lin and Kevin for yours helps, I will keep you posted on the progress.
Have a nice time,
Best regards,
Palm
04-07-2015 04:35 AM
Dear Kevin,
I can understand the suggested setup that the setup based on the Implicit Buffered Semi-period measurement, in which the signals to be counted is routed to the Source input of the counter and the Laser signals (ON/OFF) is routed to the Gate input. A question raises here: Does it matter if both signals are not periodic?
I'm taking the point from your suggestion that the polarity is thing I should be carreful. In the following Fig., if I want to count only the # photon while the laser is ON, should I leave out all the "odd" values from the returned data array ( keeping 3, 2 while ignoring 1 in this case)?
Thanks again,
Regards,
Palm
04-08-2015 03:19 PM
Assuming your Laser ON signal is active high then yes, you would want to keep all the even indices (photons counted during Laser high time) and ignore all the odd indices (photons counted during Laser low time).
You can explicitly configure the task to start counting on your chosen edge. If not configured, the default is to start on a Rising edge so that index 0 of the measurement array would be photons counted during the gate's high time. Below is a snippet that shows an additional property for configuring this polarity as well as a handy Decimate Array function that'll make it easy to split the full measurement array into even and odd indices.
-Kevin P
04-10-2015 02:24 AM - edited 04-10-2015 02:24 AM
It is great, Kevin, my program for photon counting runs perpectly. Thank you very much.
Best regards,
Palm,