MATLAB Answers

HJ
0

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

Asked by HJ
on 4 Jan 2018
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 Comments

Do you display what type of data is being sent to the device?
Yes..I made sure I sent uint8

Sign in to comment.

1 Answer


Does reducing the baud rate help?

  0 Comments

Sign in to comment.