Serial vs. Serialport questions

조회 수: 4 (최근 30일)
John
John 2021년 4월 27일
댓글: cr 2023년 4월 17일
I had a few questions about differences between the legacy serial objects and the newer serialport implementation. Any help would be quite welcome:
What is the expected time-frame for retiring the serial interface?
We have a substantial codebase using the legacy serial classes and I'm wondering about the time frame for moving to serialport.
What advantages does serialport offer?
Despite the documentation of API differences there seems to be very little information about the actual functional differences between serial and serialport. Are there substantive differences between the two? Have there been any official statements explaining why the old interface is being deprecated?
What about lost functionality?
One particular difference that seems problematic is that there seems no way to close a serialport objects. There are a number of Answers claiming that you can just delete the serialport, but this far from equivalent functionality. It's pretty common for us to close the serial object in Matlab, access the same com-port temporarily in another application for specialized tasks, and then reopen the port in Matlab. It has been quite useful to store information in the serial.UserData struct and if we are forced to delete the serialport object and recreate it, there is significant overhead to cache the UserData somewhere and then reconfigure the port when we want to use it again.
  댓글 수: 2
Connor Olsen
Connor Olsen 2021년 10월 26일
I would also love to know the answers to these questions. Swapping to the new serialport class has fixed one issue in my code, but the lack of way to close the object has been very anoying. Additionally, the new class I've built around the serialport object seems to take longer than the code using serial did.
cr
cr 2023년 4월 17일
Almost been 2 years and staff didn't notice/bother to answer?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Serial and USB Communication에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by