DAQ output randomly stops during continuous acquisition

8 visualizzazioni (ultimi 30 giorni)
I am using the following code to output a constant voltage on channel 2 of a NI-PCI-6229 DAQmx device. I am using Matlab R2014a.
The problem is that after some period of time (sometimes 5-20 minutes), the device stops outputting the data continuously. After stopping, the device property: IsDone changes from 'flase' to 'true'. No error messages are generated upon completion.
devices = daq.getDevices;
s = daq.createSession('ni');
s.Rate = 10000;
s.IsContinuous = true;
addAnalogOutputChannel(s,'Dev1',2,'Voltage');
outputSignal = ones(s.Rate,1);
queueOutputData(s, outputSignal);
lh = addlistener(s, 'DataRequired', @(src,event) src.queueOutputData(outputSignal));
startBackground(s);

Risposte (3)

Rebecca Krosnick
Rebecca Krosnick il 22 Gen 2016
I tried running your code in MATLAB R2014a (after creating the simulated device in NI MAX) and got the following output in MATLAB:
Warning: This change caused queued output data to be flushed. Use queueOutputData to queue data before starting the object.
Queue at least 5000 scans to output buffer. See NotifyWhenScansQueuedBelow for more information.
Did you not receive these errors? Try changing "outputSignal" to be a vector of 5000, as the error message suggests. For example:
outputSignal = ones(5000, 1);
  1 Commento
David P
David P il 25 Gen 2016
Yes, I replaced this piece of code with 1 to make it simpler to understand my problem, but I didn't realize it was wrong. The output vector should be a vector of ones. I have changed this in my original question now. Thanks for your response and sorry for the confusion.

Accedi per commentare.


Timothée
Timothée il 23 Mag 2018
Hi,
Did you solve this problem? I have the same issue. It stops after around 3.5 hours at 1MHz and this time seems reproducible.
  3 Commenti
Alex King
Alex King il 3 Dic 2018
I'm also having this issue, with both the NI USB-4431 & USB-6356. I'm trying the suggestion from the other answer now, queuing more than 5000 samples of output data, even though I do not get this warning.
The time it stops seems to be reproducible here too (although different for the two cards). I will try to find time investigations with different sample rates. Perhaps it has to do with the buffer size of the card?
Windows 7 & 10, MATLAB R2018b

Accedi per commentare.


Hooman Sedghamiz
Hooman Sedghamiz il 24 Ago 2019
I have seen many questions in regards to DAQ session issues, some even dating back to 2016 but no answer so far. I am having the same issue and the output generation stops everytime at sample number 8196, even when I change the signal which is being outputed...
Is this a bug? Please be kind and resolve this!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by