LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pci-6602/ period measurement

I use the pci-card to count the arrival time of photons in my detector (photonmultiplier PMT). Until now we use the progam I enclose within this mail. But that program is to slow because it asks frequently if there is a photon or not in the detector. My aim is to change that program so I could read during a period of 10sec the arrival time of photons in my detector and then put results in a screen and then read again the arrival time of photons. How could I change this program to do that?

Thanks
0 Kudos
Message 1 of 5
(2,447 Views)
Hi anneton,

I might be able to provide some help but I'm not sure what you are trying to accomplish. From your code it looks like you are generating a 50Hz square wave out of one counter, which is used to count (gate or latch) the number of photons that have arrived on the source (I assume) of your second counter.

If you want to check for the number of photons that have arrived in a 10 second interval, you would change the frequency of your pulse train from 50Hz to 0.1Hz. If you still want to count the number of photons in a 50Hz (20ms) interval but you want to read your buffer and display it on the graph every 10 seconds then you would have 500 data points (since you have 50pts/second). You would need to change the "counts to read at a time" from 1 to 5
00. You should also change the timeout from 10 seconds to 20 seconds since you will be reading every 10 seconds. I would also increase your buffer size from 1000 to 2000 so that you have more than just 2 read buffers of info (500 each). Finally, in your main processing loop, I would add a 9-10 second wait.

However, I would probably advise to read 50 counts at a time in your loop and have a 0.9-1 second wait. This would update your screen every second with new data.

Anyway, if you could explain exactly what you are looking to accomplish I might be able to help you out. Have a good day.

Ron
Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(2,447 Views)
Hi Ron,
Thanks for your help.
I want to do a buffered period measurement.This means that for tens seconds, my count will measure the period of subsets of my signal and save them to a buffer. We then continuously read the data out of the buffer. The frequency (internal clock) should be 80Mhz (12.5ns/pulse).I don t know how to use counter pair ( counter 0 and 1 / counter 1 and 2)? I will use first one PMT and then two PMT. I enclose within this email the graphics output I d like to have (with 2 PMT). I hope it helps you to understand.
Have a good day. Thanks.
Anne
Download All
0 Kudos
Message 3 of 5
(2,447 Views)
Hi Anne,

You might not need to worry about much of this. From what I understand, you would like to the number of inputs in a given period of time so you can graph the output. Let me know if I'm wrong, but you want to how many of your pulses fall into a small period of time and you want to be able to graph a continuous spectrum of these values. So for example, you can measure the number of pulses that occur every 1ms so that you can graph an output with a resolution of 1ms. Lets say you get 15 pulses in the first 1ms interval and then 27 in the next and so on... you can build a graph from these data points. Is this correct?

What is the period of time you want to measure photons (1ms, 10ms etc.)? Because this should be the rate at which your first pulse train generates at. The second issue is that you want to read all this data every 10s. This means you would need a counter buffer larger enough to store roughly 20s worth of data. You would also need to change the "counts to read at a time" terminal to 10s/1ms = 10,000 counts (if your period of sampling the number of photons in a period is 1ms). That being said, the only 3 things you really need to change is your buffer size (instead of 1000 use 20s/1ms = 20000), your counts to read at a time (instead of 1 use 10000) and finally, add a wait until next ms multiple VI in your buffer read loop that will wait almost 10s. This is to prevent your system from locking on the Counter Read Buffer.vi.

A more efficient way to do this is to wait 100ms in your buffer loop and use 2 Counter Read Buffer VIs. The first one will read 0 counts to read at a time. You will want to monitor the "scan backlog" terminal to see if it is greater than 10,000 (10s worth of data). If it is, then use the 2nd Counter Read Buffer.vi to read 10000 points. But if it is not greater, you will not want to read points from the buffer yet. You can use a case statement to accomplish this task (if true read 10000 points, if false don't do anything).

Anyway, I hope that helps you out. Have a good day.

Ron
0 Kudos
Message 4 of 5
(2,447 Views)
Hi Ron,

Thanks for ur help. I tried to use 2 counter read buffer.vi but cudnt get it work. Could you change my program so I could get a graphic output as I describe in my last mail. How could I add another counter pair (2&3) for the second PMT detector? Have a good day.
Anne
0 Kudos
Message 5 of 5
(2,447 Views)