GUI SERIAL COMMUNICATION INTERRUPT FUNCTION

4 vues (au cours des 30 derniers jours)
Daniel
Daniel le 21 Avr 2016
Commenté : Jeff King le 16 Jan 2018
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

Réponse acceptée

Walter Roberson
Walter Roberson le 21 Avr 2016
handles.serPIC.BytesAvailableFcn = @MyInterruptFcn;
handles.serPIC.BytesAvailableFcnCount = 1; %or as appropriate
fopen(handles.serPIC)
  6 commentaires
Daniel
Daniel le 21 Avr 2016
thanks you its working
Jeff King
Jeff King le 16 Jan 2018
Thanks, this post was extremely helpful!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by