python-seabreeze icon indicating copy to clipboard operation
python-seabreeze copied to clipboard

Timeout, or abort, needed for proper trigger support

Open drmcnelson opened this issue 2 years ago • 5 comments

spectrometer and system information

USB2000, etc - all models with external trigger capability

current problem

To adequately support triggered operation, the API to retrieve spectra, absolutely needs to have a timeout parameter, or at least a way to abort the intensities() call while it is waiting for a trigger.

drmcnelson avatar Jan 19 '22 00:01 drmcnelson

Hi @drmcnelson,

This will be a bit more involved. It's possible to change the pyseabreeze backend to allow pass-through of a timeout value. For the cseabreeze backend these USB timeouts are hardcoded, so it'll involve more work to implement.

I will implement the functionality for pyseabreeze first. But I'm currently pretty overloaded with work, so this is a very low priority right now.

I'll update this issue when I start work on this. I can also give some guidance on how to implement this feature, if someone volunteers to work on a PR.

Cheers, Andreas 😃

ap-- avatar Jan 20 '22 21:01 ap--

Yes, I saw where it would go in the pyseabreeze code. An abort could be a useful alternative for some use cases.

drmcnelson avatar Jan 20 '22 22:01 drmcnelson

Note to self: It seems there's no easy hacky way to do this with the sync interface: https://libusb.sourceforge.io/api-1.0/libusb_io.html#sync

ap-- avatar Aug 07 '22 07:08 ap--

Yes, it looks messy. The comment that they need to be called to handle events seems a little concerning.

I have been using the device in triggered mode for clocked data acquisitions. So I'm getting along with out it for the moment.

Thank you for looking into it.

drmcnelson avatar Aug 07 '22 13:08 drmcnelson

user space thread to implement a watchdog timer? (provided the overhead is small)

But again, I don't want to cause you extra work. It has been working very well as is, for my clocked data acquisitions.

At this point, I am pretty sure I would not change my code to use the timeout.

drmcnelson avatar Aug 07 '22 13:08 drmcnelson