Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

count single photons (TTL pulses) for 2D imaging

Hi,
I have been trying to follow a previous thread about counting with a PMT.  It is however a bit complicated for me being relatively new to Labview and DAQmx in particular.
I have a very similar application which even sounds a bit simpler than the original post.
I have random TTLs coming from a photon detector which I want to count the number of pulses in a given time bin.  However, after collecting over this bin (say 4ms), I want to stop counting and reset the counter.  Basically, I am collecting a fluorescence image, so at a given point in my 2dimensional scan, I collect photons for 4 ms, then I stop counting, move the scanning stage to the next pixel, and count again for 4 ms, etc etc. until I have sampled each point in the 2d scan.

I have my photon TTL pulses going to one input pin, and I have a clock pulse going to another input pin of my BNC 2110. 
Right now what I have done is used "DAQ Assistant" edge counting with the acquisition mode set to "1 Sample (HW timed)" .  This is where I get a bit confused.  I am not entirely sure how to tell Labview to only collect for 4ms.  (I would ideally like to include this in the front panel as a control, where the user could select the integration time per pixel for the scan)  I have my external closk set to 250 Hz, so that 1 Sample equates to 4ms.  Is my understanding correct in how Labview counts the pulses here?  Once this count is complete, I then DAQ mx stop task.vi to stop the DAQ Assistant and effectively reset the counts to zero.  Next time around the loop (i.e. next pixel) it does it all over again.
I am convinced there is an easier way, or more elegant way, to do this.  For instance: do I really need an external clock?  It seems bizarre that with all the electronics in the PC and card, that I can't get a clock from somewhere ...! ( I have the PCI 6229 by the way).
Another strange thing, that could be an effect of how I collect counts, is that there seem to be random spikes in the counts occuring through the data.  This is not likely from the detector, but seems to be electronic noise from within the card/PC.
Anyway help would be much appreciated.
CHeers,
Jim
0 Kudos
Message 1 of 3
(3,483 Views)
So you are trying to count TTL pulses for 4ms periods then raster scan an image of fluorescence image, pixel by pixel?  I had done something like this in the past it is not so hard, you will need 2 counters to do this.  Configure the first counter to count events while high (assuming the TTL pulse is not comming in too fast to count) and configure the source of the TTL to the PFI line attached to your PMT signal.  Now set the second to counter to put out a singal pulse (not a pulse train) of 4ms wide.  Configure your first counter to have its gate pin as the output of the secont counter.  Now everytime the second counter goesw high (configured for 4ms) the events will be counted.  Now for your image algorithm in 2D:
 
Configure Counters()
For each Pixel{
    Pulse_Counter_2
    Read_A_Point_Counter_1
    Move_Stage
}
 
Save the values of the counter1 in a 2d array and feed this to an intensity plot for a quick visualization.  Sorry I didnt have time to code this up for you.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 3
(3,470 Views)

Guys,

 

I'm trying to do the same thing for a Raman setup. I was able to code it up in C# for the case where the scan movement is  software timed. However I want this to be HW timed also.

 

I posted about it here:

 

http://forums.ni.com/ni/board/message?board.id=40&thread.id=2779&view=by_date_ascending&page=2

 

Do any of you have any ideas or possibly some example code. If needed, I can also provide insight into my code...

0 Kudos
Message 3 of 3
(3,207 Views)