How to get the data from the RS 232?

8 views (last 30 days)
Changwoo Lee
Changwoo Lee on 26 Jan 2022
Edited: Shivam Lahoti on 10 Nov 2023
I have a RS232 that connected to the Computer at COM 1.
Then, I want to recieve the data from the RS 232 in real-time.
Using the below simulink blocks, is it possible to recieve the data?
Host Serial Setup:
Host Serial Receive:
In more detail,
"Host Serial Receive" requires the information on "pakage header, pakage terminator, sample time", as follows:
What is the proper value setting for the RS 232?

Answers (1)

Shivam Lahoti
Shivam Lahoti on 10 Nov 2023
Edited: Shivam Lahoti on 10 Nov 2023
Hi Changwoo Lee,
Based on your description, you have an RS232 connection established between your computer and Com1, and you wish to receive real-time data. You are uncertain about using the Host Serial Receive block for this purpose.
Receiving data in real time through serial connections, specifically RS232, is indeed possible. The documentation mentioned below provides information about the feasibility of using the Host Serial Receive block for this task.
To establish communication and configure the receiver block, please refer to the provided answer as an example. You can use it as a starting point and adapt it to suit your specific use case and requirements. The answer’s zip file contains a pdf file talking in detail about different configurations for simple read block.
I hope this was helpful.
Regards,
Shivam Lahoti.

Community Treasure Hunt

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

Start Hunting!