LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Photon Counting with an Oscilloscope

I am faily new to LabView, and I am trying to emulate a photon counter with a digital oscilloscope for determining fluorescence lifetimes. So far, the program downloads the waveform from the scope and determines the arrival time of each peak above the discriminator/threshold. But, I cannot figure out how to sum the counts for each time bin - ie add and store a count for each value in the "locations" array, and then store all the counts into a histogram. Any help is greatly appreciated.
0 Kudos
Message 1 of 6
(3,433 Views)
I added some arrays in a loop to tally the counts, but it doesn't seem to work. The peak detector outputs an array with the arrival time of each peak. The first index array function parses each arrival time, which is used as the index for the total counts array. The second index array should output the current count for that time bin, and then one count should be added to this element in the replace array function. The updated total counts array is then displayed in a histogram. Please help. TIA.

0 Kudos
Message 2 of 6
(3,405 Views)
Here is the code for what I am having problems with in LabView:

for (i = 0; i < peaksDetected; i++)
    totalCounts[ Locations[i] ]++;
next i
0 Kudos
Message 3 of 6
(3,380 Views)
The Replace array subset does nothing with an empty array. Do you fill the Total Counts array with the right number of elements before running the VI? I modified the VI to initialize the array with the number of elements in the peak location array. I also set the for loop to autoindex on the locations array and removed most of the coercion dots. Without any data I cannot test.

To give us some data, run a sample of some data and Make the Current value default on the Current Waveform graph. Then remove the Instrument IO Assistant and convert the Current Waveform graph to a control. Save the modified VI and post it.

Lynn
0 Kudos
Message 4 of 6
(3,370 Views)
Thanks John for pointing me in the right direction. I moved the initialize array outside of the main loop so the counts are stored through all loop iterations, and  I replaced the intrument interface with a signal generator. Although Poisson noise doesn't replicate pulse shape, the concept works.
0 Kudos
Message 5 of 6
(3,355 Views)
Try making the number of bins greater than or equal to the number of points in your signal. (I think you set it at 50). The array of counts must have a number of elements >= number of elements in the peak locations array. I changed the number of samples in the signal to 500, set the number of bins to 500, and the number of pulses to 100 and I get what seems like reasonable data from looking at the Current Waveform signal. I also initalized the counts array to -1 to easily distinguish points which never appeared in the Peak Locations array.

Lynn
0 Kudos
Message 6 of 6
(3,348 Views)