In Simulink, how can I send uint8 array through an RS232-usb cable?

1 visualización (últimos 30 días)
Hi. I'm trying to send an array of 9 uint elements from the PC to my device via an RS-232 to USB cable (bought from Startech) in a Simulink environment.
These are some of things I have tried so far: 1. use "to instrument" block or "serial send" block -> The array data didn't seem to properly reach my device. The device did detect something, so there seems to be a problem with the content of data during communication. 2. use the mat function that was built-in with my device by "matlab function" block -> serial class didn't support code generation, so I had to create an equivalent C function and use coder.ceval to call the function. Still working on it, since I got the same problem as #1.
I would like to know if anyone had similar experience with RS-232 commuincation in Simulink. I am out of ideas.. :( Thanks.
  2 comentarios
Birdman
Birdman el 4 de En. de 2018
Do you display what type of data is being sent to the device?
HJ
HJ el 4 de En. de 2018
Yes..I made sure I sent uint8

Iniciar sesión para comentar.

Respuestas (1)

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis el 8 de En. de 2018
Does reducing the baud rate help?

Community Treasure Hunt

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

Start Hunting!

Translated by