How do I replace the step command for running an object in MATLAB2018a

In the following code;
DataRecorder = dspdemo.DAQRecorder(...
'DeviceName', deviceName,...
'SamplesPerFrame', samplesPerFrame,...
'SampleRate', sampleRate,...
'ChannelNumbers', 0,...
'OutputNumOverrunSamples', true);
%%Acquire data continuously
% Acquire data through a simple while loop, until the time reaches the
% value previously defined in endTime.
% To terminate the acquisition manually press CTRL+C
tstart = tic;
while (toc(tstart) < endTime)
% Use step method to acquire SamplesPerFrame at a time from the device
[data, numov] = step(DataRecorder);
if(~isempty(data))
plot(data), set(gca,'Xlim',[0, length(data)-1])
drawnow
end
if(numov > 0)
fprintf('Samples overrun: %g\n',numov)
end
end
In the above code the specific command;
[data, numov] = step(DataRecorder);
does not work in Matlab 2018a
How can I run that object in the same manner using Matlab2018a
I don't understand how objects work!
Thank you

답변 (3개)

Branko Celler
Branko Celler 2018년 6월 10일

0 개 추천

Are you saying, replace command [data, numov] = step(DataRecorder); with [data, numov] = step();
That generates an error Error in DaqBasicAnalogInExample (line 61) [data, numov] = step();
and runs a demo of the step function!

댓글 수: 1

No. You told us that that specific command does not work in MATLAB R2018a, but you did not tell us how you know that it does not work. Does it produce an error message? Does it accept the command but nothing happens?

댓글을 달려면 로그인하십시오.

Branko Celler
Branko Celler 2018년 6월 10일
편집: Walter Roberson 2018년 6월 10일
The code comes from the following:
When I run the program at a much slower sampling rate (500samples/sec), the program runs and ultimately shows a plot after it completes, but generates the following warning;
>> DaqBasicAnalogInExample
Warning: DesiredTerminalConfiguration specified not supported
> In dspdemo.private.DeviceManager/constructSessionDevice
In dspdemo.private.DeviceManager/constructDevice
In dspdemo.DAQRecorder/setupImpl
In DaqBasicAnalogInExample (line 60)
line 60 is the command;
[data, numov] = step(DataRecorder);
I hope that this is a little clearer!
Regards
Branko

댓글 수: 1

Unfortunately that involves a toolbox that is not available for my Mac, so I cannot look at the code at the moment.

댓글을 달려면 로그인하십시오.

Branko Celler
Branko Celler 2018년 6월 10일

0 개 추천

Thank you for your efforts. However for some strange reason it is now working. I still get the warnings, but I am collecting and displaying data It may have had something to do with my setting up of the NI device

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2018년 6월 9일

답변:

2018년 6월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by