Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Handling serial data transfers

1 visualización (últimos 30 días)
Glenn
Glenn el 13 de Jun. de 2013
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I have Matlab reading serial data for a device by using callbacks. This is important as it allows the user interface to remain responsive while updating the display with information from the serial data stream. However, there are times when I need to transfer large amounts of data from the device. The only way to handle this is to run in a tight loop for good performance. The problem is that there seems to be no way to turn off the callback feature so that I can just read in a loop. If I leave the callback enabled Matlab seems to cache all of the callbacks that aren't serviced while in the loop and eventually crashes. I start the session like this:
comport = ['COM' get(handles.edit1,'String')];
handles.s = serial(comport,'BaudRate',115200,'DataBits',8,'Timeout',5);
handles.s.BytesAvailableFcnCount = 1;
handles.s.BytesAvailableFcnMode = 'byte';
handles.s.BytesAvailableFcn = {@serialCallback,handles,hObject};
When the device goes into transfer mode I need to disable the callback. How do I do this?

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by