Serial vs. Serialport questions
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
John am 27 Apr. 2021
Kommentiert: cr am 17 Apr. 2023
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.
Find more on Serial and USB Communication in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!