GUI SERIAL COMMUNICATION INTERRUPT FUNCTION

6 views (last 30 days)
I want to run a serial communication with a device.
i want all incoming messages to be displayed automatically. don't want to press a special button for that.
i tried using the
handles.serPIC.BytesAvailableFcnCount = @MyInterruptFcn
...
...
...
function MyInterruptFcn(hObject, eventdata)
{code for the interrupt function}
end
but this has no result

Accepted Answer

Walter Roberson
Walter Roberson on 21 Apr 2016
handles.serPIC.BytesAvailableFcn = @MyInterruptFcn;
handles.serPIC.BytesAvailableFcnCount = 1; %or as appropriate
fopen(handles.serPIC)
  6 Comments
Jeff King
Jeff King on 16 Jan 2018
Thanks, this post was extremely helpful!

Sign in to comment.

More Answers (0)

Categories

Find more on Instrument Connection and Communication in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!