MATLAB: GUI SERIAL COMMUNICATION INTERRUPT FUNCTION

callbackguiinterruptserial communication

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

Best Answer

handles.serPIC.BytesAvailableFcn = @MyInterruptFcn;
handles.serPIC.BytesAvailableFcnCount = 1; %or as appropriate
fopen(handles.serPIC)