Error with Callback

1 次查看(过去 30 天)
Steve
Steve 2012-2-13
编辑: Cedric 2013-10-10
I am trying to use the GUI environment to obtain data from the serial port. Ideally I would like to have a serial config file serparate from my main file with the toggle button callback and everything, but that has been giving me trouble.
So I am trying to do the serial config whent eh toggle button is pressed. So far when I run the program, the program plots the data coming into the serial port just fine, however when I stop the program by pressing the toggle button, I get these errors:
Error in ==> TEST>togglebutton1_Callback at 122
Out5(i) = fread(s);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> TEST at 45
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)TEST('togglebutton1_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
My filename is TEST...I'm not sure how to get around this. Am I going about this in the right way?
Any advice would be greatly appreciated!
Thank you
  1 个评论
Walter Roberson
Walter Roberson 2012-2-13
What actual error does it report? For example does it report that s is not open, or that it does not exist?
It is not clear why your stop routine would have an fread() ?
I think we are going to need code.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by