DAQ output randomly stops during continuous acquisition

8 ビュー (過去 30 日間)
David P
David P 2016 年 1 月 20 日
コメント済み: Walter Roberson 2019 年 8 月 25 日
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);

回答 (3 件)

Rebecca Krosnick
Rebecca Krosnick 2016 年 1 月 22 日
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 件のコメント
David P
David P 2016 年 1 月 25 日
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.

サインインしてコメントする。


Timothée
Timothée 2018 年 5 月 23 日
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 件のコメント
Timothée
Timothée 2018 年 5 月 23 日
Ok, thanks for replying!
Alex King
Alex King 2018 年 12 月 3 日
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

サインインしてコメントする。


Hooman Sedghamiz
Hooman Sedghamiz 2019 年 8 月 24 日
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!
  1 件のコメント
Walter Roberson
Walter Roberson 2019 年 8 月 25 日
Have you tried configuring a larger input buffer size?

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by