How to implement Ethernet Communication in Simulink Desktop Real-Time

I want to use Ethernet Communication within Simulink Desktop Real-Time. But I do not find corresponding I/O block in Simulink Desktop Real-Time Library. Should I use Stream Input and Stream Output Blocks?

 채택된 답변

Jan Houska
Jan Houska 2023년 12월 5일

0 개 추천

Hi Chuguang,
it depends on what you mean by Ethernet Communication. If you mean UDP or TCP/IP (which both often work over Ethernet), you can use either Packet Input/Packet Output blocks if your data is structured as messages of fixed size, in binary or text format. Or you can use Stream Input/Stream Output blocks if your data is a stream of messages, typically ASCII text. For any of these blocks, please select the appropriate protocol driver using the Install New Board button.
You can also take a look at the sldrtex_packetio and sldrtex_streamio shipping ewxamples that can give you an idea of the correct implementation.
Good Luck, Jan

댓글 수: 2

I know, thanks very much!
Hello Jan, I meet another issue when I use Packet Output block. There is only UDP Protocol, but I want to use TCP Protocol.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jan Houska
Jan Houska 2023년 12월 6일

0 개 추천

Hi Chuguang,
this means that you are using a very old version of MATLAB. TCP protocol support has been added in R2018a, almost six years ago. You should upgrade to at least R2018a to use TCP protocol.
Jan

댓글 수: 1

Thank you very much for your answer, I will upgrade my MATLAB version.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Model Preparation for Real-Time Simulation에 대해 자세히 알아보기

제품

릴리스

R2016b

질문:

2023년 12월 4일

댓글:

2023년 12월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by