Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
GETDATA timeout occured Error

Subject: GETDATA timeout occured Error

From: Y1lmaz

Date: 2 Sep, 2009 13:30:23

Message: 1 of 3

  Hi;
I want to make a data acquisition gui.
I wrote a function;

function taking_data
  %I create analoginput

 ai = analoginput(winsound);
addchannel(ai,1)

ai.TriggerRepeat = Inf;

  %I creat two subfunction
 FUNCTıON taking_data_start(obj, eventdata)
   start(ai)...

  %I used a for loop to take all data
  for i = 0:ai.TriggerRepeat
  [d,t] = getdata(ai);

  
 FUNCTıON taking_data_stop(obj, eventdata)
 stopdata(ai)


%%%%%%%%%%%%%%%%%%%%%%%
I make two button on my gui.
I call the function from my pushbuttons callback function.

But when I push the stop button I take "A timeout occured during GETDATA" error.

How can I get over this?

I want to able to cut data acquisition whenever I want

Thanks for your helps
Regards

Subject: GETDATA timeout occured Error

From: Sherryl Radbil

Date: 3 Sep, 2009 12:10:06

Message: 2 of 3

Hi,
Typically getdata times out when you try to get more data than is available in the Data Acquisition Toolbox engine, which you can learn about here:
http://www.mathworks.com/access/helpdesk/help/toolbox/daq/brci3ty-1.html#brci3ty-3

You may be trying to extract data from the engine faster than it is coming in.

Instead of calling
getdata(ai)
which gets ai.SamplesPerTrigger samples each call, get only as much data as is available:
getdata(ai, ai.SamplesAvailable)

All the best,
Sherryl

Subject: GETDATA timeout occured Error

From: Y1lmaz

Date: 7 Sep, 2009 06:52:02

Message: 3 of 3

  Thanks for your reply;

I tried "getdata(ai, ai.SamplesAvailable)" but i could not take any data. When i use getdata(ai) like before, i can take data.


Actually my main problem is not to work second time.
When i run my script first time a gui opens and works regularly. But before close my gui, when it runs second time, i can not take data regularly. how can i solve this problem?

i can send you my script completely.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us