MATLAB Answers

Timothée
2

DAQ analog output stops after a fixed number of samples during long continuous signal generation

Asked by Timothée
on 23 May 2018
Latest activity Commented on by Walter Roberson
on 25 Aug 2019 at 0:17
Hello,
I am using the following example code to continuously output analog signals on channels 0 and 1 of a National Instruments USB-6251 Device. I am using Matlab R2018a.
Every 10 seconds, the queue is filled with 10 seconds of data at 0.5 or 1MHz. The problem is that after an almost fixed number of samples sent (12,884,890,000 +/- 10,000, i.e. after a bit more than 3.5 or 7 hours depending on the sampling frequency), the device stops requiring and outputing data continuously. No error message is displayed, and the porperties of the device after stopping are: ScansQueued: 0, ScansOutputByHardware: 12884899987 (for example) and IsDone: 'true'.
devices = daq.getDevices;
s = daq.createSession('ni');
s.Rate = 1000000;
s.IsContinuous = true;
s.NotifyWhenScansQueuedBelow = 10*s.Rate;
addAnalogOutputChannel(s,'Dev1',0,'Voltage');
addAnalogOutputChannel(s,'Dev1',1,'Voltage');
outputSignal = ones(10*s.Rate,2);
queueOutputData(s, outputSignal);
lh = addlistener(s, 'DataRequired', @(src,event) src.queueOutputData(outputSignal));
startBackground(s);
Notice that I tried to manually queue data by calling s.queueOutData every 10 s instead of using addlistener. In this case, there is no error, but no signal can be seen from the analog output ports.
Does anybody has an idea of what is going on?
Thanks!

  0 Comments

Sign in to comment.

1 Answer

Answer by Hooman Sedghamiz on 24 Aug 2019 at 22:52

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... The device i use is a NI-USB-6211 which is supposed to be SUPPORTED!
Is this a bug? Please be kind and advice!

  1 Comment

Did you try configuring a larger buffer size?

Sign in to comment.