Borrar filtros
Borrar filtros

Send decimal vector via serial port connection

10 visualizaciones (últimos 30 días)
Rick Saner
Rick Saner el 15 de Nov. de 2021
Respondida: Pavan Guntha el 23 de Nov. de 2021
I am trying to send a vector of deciaml numbers to a controller via a USB cable using a Simulink model. I am struggling to establish serial communication with the controller and can't send my generated vector. I tried using the 'Serial Send'-Block in Simulink which I believe can only send binary data. However, I need to send a decimal vector.
Thankful for any help!

Respuesta aceptada

Pavan Guntha
Pavan Guntha el 23 de Nov. de 2021
Hi Rick,
You could have a look at the following similar queries on MATLAB Answers community:
Writing an array of numbers to serial port - This illustrates the use of 'fwrite' command to accomplish the task of transfering an array of decimal numbers to a serial port.
send array from matlab using serial communication - The solution illustrates the use of 'fprintf' to do the required task.
For more information, you could have a look at the documentation pages of fwrite and fprintf.
Hope it helps!

Más respuestas (0)


Más información sobre Simulink Functions en Help Center y File Exchange.


Community Treasure Hunt

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

Start Hunting!

Translated by