Information on callback execution
Hi,
I am building an application including real-time streaming of data from the DAQ. I would need some information on the execution models of callbacks such as those provided to functions register_every_n_samples_acquired_into_buffer_event. What happens when the task is running and this callback is executed? Is there a parallel thread launching the event and executing the callback? Is it a blocking execution?
I couldn't find anything in the documentation, but since the execution model in Python can be various (multiprocessing, asynchronous, thread-based, etc) it would be nice to have some clarification on this point.
The implementation is this:
- task.py::register_every_n_samples_acquired_into_buffer_event
- _library_interpreter.py::_library_interpreter.py
- NIDAQmx C API, DAQmxRegisterEveryNSamplesEvent - documentation on ni.com here
You can see that we pass 0 for the options parameter in task.py. The documentation says
The callback function is called in a DAQmx thread. This is the default value.
If this is useful, feel free to make a PR to task.py to update the documentation! If there are more questions you have, let me know. I can dig into the internal code deeper.
THank you very much for the answer! As soon as I will have a bit of time I will prepare the PR