Exchanging data from data acquisition listener to GUI

조회 수: 1 (최근 30일)
Rajeev Yadav
Rajeev Yadav 2014년 3월 31일
댓글: Rajeev Yadav 2014년 4월 1일
I am trying to create a buffer to store data between each listener call (when data is available)via a GUI. Could you give some idea as to how to achieve it?
I tried global variables, storing the data in handles but it doesn't work.
Thanks RY

답변 (1개)

Joseph Cheng
Joseph Cheng 2014년 3월 31일
When you try to store the data in handles did you update the handles object with:
guidata(hObject, handles);
  댓글 수: 1
Rajeev Yadav
Rajeev Yadav 2014년 4월 1일
Thanks Joe, I understand your point. The problem is not that simple. I am already invoking the DAQ session via a button event. The DAQ allows to call a listener when a set number of samples are available for processing. I can use the listener to plot and store to file. The code snippet is as below:
lh = s.addlistener('DataAvailable', @(src, event) plotData(src, event, fidData, handles));
s.NotifyWhenDataAvailableExceeds = str2double(get(handles.tNumSample, 'string'));
s.startBackground();
My problem is to access data from one listner call to another.
Thanks RY

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

카테고리

Help CenterFile Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by