Closed 2WG73 closed 6 months ago
DAQmx tasks aren't shareable across processes. Looking at your instrument class, it appears you're relying on that. The Instruments
class creates the task in __init__
. Then, later, you spawn a separate Process
to handle the write
operations of that task, which doesn't exist in the other process. If you want this to work, I'd suggest moving all of the DAQ configuration into the Process
method.
Makes sense ! Thanks
Thanks a lot
Ubuntu 18.04. Tested with Python 3.10.9 nidaqmx 0.9.0
I am using
multiprocessing
together with plotly-dash and nidaqmx. I am also usingBackground callback
from dash.I have the following
Instruments
class:I instantiate the class in the main process :
Here, my background callback does not work.
If, however, I comment
it works.
If, however, I use a standard callback (not a background callback) together with
it works.