Info

This question is closed. Reopen it to edit or answer.

Cannot gather lots of data with GETDATA?

1 view (last 30 days)
Samuel
Samuel on 21 Jul 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I'm running 32-bit MATLAB R2013a on Windows XP with the NI USB-6218.
Here's my code:
ai = analoginput('nidaq', 'Dev2');
ai0 = addchannel(ai, 0);
ai.SampleRate = 1000;
start(ai);
pause(0.2);
for i = 1:1:2000
data = getdata(ai, 1)
end
delete(ai);
---
So I run the loop 2000 times... If I run it just 1000, everything is fine and dandy. When I try to run it 2000 or more, I get the error:
Error using daq.analoginput_nidaqmx_1_22/getdata
OBJ is not running and no data is available. Use START before calling GETDATA
Does anyone know why this happens and how I can prevent it from happening? Thanks.
  1 Comment
Eleanor Hassan
Eleanor Hassan on 19 Mar 2020
Hi Samuel,
Did you ever resolve this issue?
I am having a similar problem.
Best,
Ellie

Answers (0)

Tags

Products

Community Treasure Hunt

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

Start Hunting!