DAQ output randomly stops during continuous acquisition

조회 수: 4 (최근 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!

Community Treasure Hunt

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

Start Hunting!

Translated by