Serial rs232/422 500K baud in simulink real time

12 views (last 30 days)
For some time now i have been exploring the possibilities of streaming serial data in real time into matlab. I have a specific device that can be set to output data at 500k baud on a continuous stream. I have written many scripts that create serial port objects and poll the hardware for its data. However you are really limited at that point by the time it takes to read the buffer and the slower baud rates of the non continuous output mode of this particular hardware
The max baud for non continuous mode is 38400 Pretty slow obviously When in continuous mode it can continuously stream its data into the serial port of a machine at 500k baud.
I have contacted matlab with little success. They indicated i should look into simulink real time desktop
The end result would be to stream the data in real time, parse the data through some parsing scripts i have already written to acquire the correct data and then store it all in a matrix
Im just looking for a brain storming session here with you other matlab gurus I have never attempted real time work before and have barley scratched the surface of simulink I was looking through the different DAQ boards supported by simulink but don't see anything that handled rs232 or 422 directly. In the documentation matlab says it supports several communication protocols but i can't seem to find any info on which ones and no examples anywhere unless you are using one of their real time target machines which i know nothing about
Any thoughts on this greatly appreciated.

Answers (1)

Walter Roberson
Walter Roberson on 6 Nov 2016
Edited: Walter Roberson on 6 Nov 2016
No, you can't do this in Simulink itself. You might be able to do it in Simulink Real Time, possibly, for which you would create a Simulink model and put it through a code generation stage. But then you encounter problems with storing the data quickly enough.
A dual stage might work, in which you had dedicated hardware to receive and parse the data and send it by tcp to something that stores into files.
Walter Roberson
Walter Roberson on 6 Nov 2016
"Answer a Question" only shows Questions that have no Answers. The full list shows up at

Sign in to comment.


Find more on Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by