Fast Counting #47
-
|
I am working on implementing a scanner and am just doing point by point measurement for simplicity. This works beautifully, but it is relatively slow since it seems that the buffer being read updates pretty slowly (~50-100ms+). Is there a way to speed up the buffer update speed. Ideally, I would like to read out integrated counts at a rate of 0.1 to 1ms if possible. So something long the lines of get_counts(integration_time) where the whole function call takes ~integration_time. I know that the obvious solution would be to hook up and program the scanner to output TTL signals to use as markers, however, I figured I would check if there is some setting or configuration that would allow for more rapid readout from the PH330 since that approach is very simple and implemented. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
|
The PH330 supports the conti mode, that do exactly what you want. But unfortunately it is not available in snAPI atm. You have to use the PH330.dll directly to use it. In Uniharp there is the adjustment mode. But you need it, to make images and therefor you need the data for each pixel? |
Beta Was this translation helpful? Give feedback.
-
|
Hi Samuel, this is very interesting. Now I understand your problem. When data arrives over the USB bus, it is also sent in blocks. SnAPI collects the data in different processing threads and also processes it in blocks. This is done for performance reasons. Accessing the USB bus takes some time, so we can't transmit each event individually. The size of the blocks received by snAPI can change depending on the data rate (count rate) or your PC's performance. I hope that helps, |
Beta Was this translation helpful? Give feedback.
-
|
Sure, your "while True:" exactly does this, but you don't have to do this that often. The buffers should be big enough to do it every second or even the rate in which your view should be updated. If you do it rarely the data blocks becomes bigger.. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you Torsten! I am hoping to move position to position to allow for different data streams (lifetime, counts, spectra) to be connected easily using the same code and these are slow enough to allow for this. So in conclusion the max read out rate of the buffer is slow enough to where trying to read the buffer per pixel has a maximum read out rate of approximately 50-100hz. So the new plan is basically to connect the markers from the scan head to the PH330 and then use those to post-process the buffer into individual pixels. One quick question:
|
Beta Was this translation helpful? Give feedback.

Sure, your "while True:" exactly does this, but you don't have to do this that often. The buffers should be big enough to do it every second or even the rate in which your view should be updated. If you do it rarely the data blocks becomes bigger..
Btw. if you use unfold.getBlock() you should start the measurement with sn.unfold.startBlock(), where you can set the acqTime and the (buffer) size. See https://picoquant.github.io/snAPI/snAPI.Main.html#snAPI.Main.Unfold.startBlock.
Normally the scan head has some signals for new line and new picture that are connected to the marker inputs: see https://picoquant.github.io/snAPI/snAPI.Main.html#snAPI.Main.Unfold.startBlock. This markers and the …