How to process TCP/IP frames with Simulink Real Time Explorer

I need for my project to communicate between an application on a computer and a target (speedgoat) with TCP/IP.
As I use the Simulink Real Time software, I have access to the block TCP/IP, which enables me to get some « string » between our application and the Target Display block.
Now I would like to send commands and exchange data via TCP/IP, i.e. create a simple protocol over TCP/IP, handle buffers, but I don’t know how to get all the TCP/IP frames into Matlab in Real Time (« To Workspace » or other logging blocks are updated when the application is paused or over). Moreover I am looking for a way to handle the buffer in a proper way.
Thank you for your help!

3 Comments

What if you used MATLAB Function block inside Simulink, and from inside the block use MATLAB's TCP functions, would that work for you? https://www.mathworks.com/help/matlab/tcpip-communication.html
Thank you for your answer, actually I don't have the Instrument Toolbox that is needed to use tcpip function in Matlab. I hoped it was possible to get the job done with the Simulink Real Time Toolbox.
From what I recall, the tcpip blocks in Simulink Real-Time also work in desktop simulation. You should be able to use the same ones.

Sign in to comment.

Answers (0)

Asked:

on 1 Sep 2020

Commented:

on 22 Oct 2020

Community Treasure Hunt

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

Start Hunting!