フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Handling serial data transfers

1 回表示 (過去 30 日間)
Glenn
Glenn 2013 年 6 月 13 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by