I'm using wxPython as the front end for a data acquistion system, the backend using PyDAQmx to interface to a national instruments card.
When the loop is called to collect the data, obviously the gui blocks, so I put the acquisition module in a separate thread using threading.Thread. However, the data comes in so fast that we actually need more than one core, which I believe threading.Thread can't do.
I next tried spawning a separate process using multiprocessing.Process & Queue to report the data back, quite simply as
captureProcess = Process(target=acquire, args=(self.settings, self.queue,))
captureProcess.start()
The data is sent down the queue with
queue.put( (i, j, c, aiData.value) )
and picked up again with
(scan, interval, count, ai) = queue.get()
Now the bizarre bit is that the gui doesn't block in the sense I can update some pyplot graphs on the main wx.Frame, but any interaction with it (clicking a menu, etc), immediately causes the program to become unresponsive and crash. Does anyone know why this might be, or any workaround?
Many thanks for your help. I'm using anaconda on Windows 7.