I'm using Matlab with NI-6731 and NI-MIO-16XE-10 to simultaneously output and read analog data on multiple channels. (I have to switch between different channel (ch) configurations quite often, and stop(ch), delete(ch), clear(ch) for this purpose, then reinitialize the channels.)
My problem is, that my program crashes regularly after like 2-8 hours, and I cannot find the reason. When the problem occurs, I get an error message when trying to start the task (what worked ~500 times before in that session). I have 3 tasks, analog output on NI-6731, analog output on NI-MIO-16XE-10, and analog input on NI-MIO-16XE-10. It is strange, that not always the same task is not responding, but from time to time it is a different one, or even multiple ones, also on different cards.
If this happens, a plane error text message, no link, printed in black is output (while the main program continues running):
Error event occurred at 09:16:12 for the object: nidaqmxDev1-AI.
A time-out occurred while trying to start the task.
At this point of the code I then check, if the tasks are actually running and starting was successful. If not, I wait for some seconds, check again. If not, I try to use "daqreset" to reset the DAQ-enginge. This sometimes brings the plane message:
Warning: Internal STOP error: Timeout waiting for OBJ to stop.
Stop has been forced.
So, I cannot find a way to start the task then from my running program.
These Messages don't look like standard Matlab errors. Can they be directly from the Nationial Instruments Driver?! (sorry if that question is dump, I'm not familiar with the exact driver structures used in DA Toolbox).
Even if I interrupt the program and restart it starting with
it doesn't work...
However, if I close Matlab, and restart it again, things work, again only for say 3-8 hours.
Is there something more to reset during a matlab session, to get closer to a restarted matlab? Perhaps unregister and reregister 'nidaq'?!
I use Matlab 2011a + current Data Acquisition Toolbox, Windows 7 32 Bit, 3GB RAM, Intel Core 2 Quad Q8400, National Instruments NI-DAQmx 9.4. Unfortunately the code is way to large to put it here.
I'm desperately waiting for some comments or speculations.