Real Time TCP/ip communication
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello all. I am quite new to matlab and simulink so please bear with me.
I have a model where I capture and process various signals. Now I want to integrate that model with an external app (C#) so I can send and receive commands/data.
My first step was to learn how to setup a simple TCP/IP server on matlab and get it to work but I want that server to be inside the model and make sure it works without interrupting the signals capturing/processing. Actually I don't care if I use the model as a server or as a client, right now I am focusing on learning.
I believe the best way to go would be to use the RTW blocks for TCP/IP in 2017b. Am I wrong? is there any other way?
I have been trying to compile and run this example:
but I always get and error when calling
rtwbuild('TargetToTargetTCPClient');
I get:
Error using coder.internal.callMakeHook
The call to slrt_make_rtw_hook, during the entry hook generated the following error: Model is configured for target computer 'TargetPC1', which does not exist
I changed the model tried the server on "127.0.0.0" and also using my LAN ip address but the error presists.
I understand I am missing something and I am quite lost. Any pointers/help would greatly appreciated.
Thank you in advance.
댓글 수: 0
답변 (1개)
Dimitri MANKOV
2021년 12월 8일
Hi Rui,
In order for this example to work, you need a target machine (for instance those made by Speedgoat), on which the real-time application compiled from your Simulink model would be loaded. In other words, your model is not running on the PC used to design it when using Simulink Real-Time.
Do you have a target machine?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Development Computer Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!