DAQ output randomly stops during continuous acquisition

8 visualizaciones (últimos 30 días)
David P
David P el 20 de En. de 2016
Comentada: Walter Roberson el 25 de Ag. de 2019
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);

Respuestas (3)

Rebecca Krosnick
Rebecca Krosnick el 22 de En. de 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 comentario
David P
David P el 25 de En. de 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.

Iniciar sesión para comentar.


Timothée
Timothée el 23 de Mayo de 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 comentarios
Timothée
Timothée el 23 de Mayo de 2018
Ok, thanks for replying!
Alex King
Alex King el 3 de Dic. de 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

Iniciar sesión para comentar.


Hooman Sedghamiz
Hooman Sedghamiz el 24 de Ag. de 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