Serial vs. Serialport questions

4 visualizaciones (últimos 30 días)
John
John el 27 de Abr. de 2021
Comentada: cr el 17 de Abr. de 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.
  2 comentarios
Connor Olsen
Connor Olsen el 26 de Oct. de 2021
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 el 17 de Abr. de 2023
Almost been 2 years and staff didn't notice/bother to answer?

Iniciar sesión para comentar.

Respuestas (0)

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by