How to disable termination character while setting up serial object?

4 vues (au cours des 30 derniers jours)
Abhilash Sukumari
Abhilash Sukumari le 26 Juil 2019
Commenté : Guillaume le 29 Juil 2019
I have to establish with a serial communication device that uses the following properties:
baud = 115200, parity = none, timeout = 500ms, termination char = None, stopbits = 1.
The matlab documentation provides all property values except that on how to disable the termination character.
Any ideas?

Réponse acceptée

Guillaume
Guillaume le 26 Juil 2019
The matlab documentation provides all property values except that on how to disable the termination character.
How about the 'Terminator' property?
  2 commentaires
Abhilash Sukumari
Abhilash Sukumari le 29 Juil 2019
This is to be used only when you want to specify a termination character. What if you are dealing with a fixed message serial protocol that doesn't have a termination character ?
Guillaume
Guillaume le 29 Juil 2019
s.Terminator = '';
%or
s.Terminator = [];
seems to work fine in that it does not throw an error even if you write to the serial port. I don't have a device connected to my serial port to check that it actually does what you want.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Workspace Variables and MAT-Files dans Help Center et File Exchange

Tags

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by