Several questions concerning serial communication
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I am currently programming a Matlab Script(with GUI via guide) to make use of a measurement system from the 90s that is connected via RS-232 to the computer.
I have several questions concerning the serial communication:
1. Is there a way to close the serial connection I opened in the script via workspace? When I am debugging my code and there is an error before the connection is closed I now need to restart Matlab. "fclose('all')" sadly doesn't work.
2. After I hit start on the Gui I want to read from the serial port as long as there is an inflow or I press the stop Button. I tried a global variables that turns on after the "Stop" button is pressed.
while isstopped == 0 && its.BytesAvailable > 0
income = fgetl(its)
.
.
.
But even though I set the ReadAsyncMode of the connection to continouus the income stops after approximately 30 lines. The Stopbutton doesn't work either.
I am grateful for any answers.
Best Regards,
Florian
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!