I am working on a simulation by coupling two software (OpenFresco and Simulink) through TCP/IP communication. It works fine when using Simulink Desktop Real-Time in Normal or Accelerator modes. But, I have tried to use external mode in conjunction with a Raspberry Pi 4 Model B (RBP4B) as external hardware, and I am having trouble generating the standalone executable before running the code in real-time.
First, I’m using Matlab release 2021a, with Simulink version 10.3 and Simulink Support Package for Raspberry Pi Hardware version 21.1.1. The Simulink model includes an S-function block written in C++, as shown below. This code allows for TCP/IP communication with the OpenFresco software running as a server on the same local network.
As I show in the following screenshots, the source code is referenced in the “Code Generation” settings window. To compile the C++ code, I have used either Microsoft Visual Studio 2019 version 16.10.0 or MinGW-w64 version 21.1.0 compilers, both with the same bad results.
In the following lines, I’ll try to explain the error message. When trying to generate the executable, multiple syntax errors appear on the screen (in Spanish):
When modifying the indicated line of code, the error is modified and replaced by another:
If I keep modifying the source code, the error continues changing. The problem with this is that the initial simulation that used to work with Simulink Desktop Real-Time and Normal/Accelerator modes doesn’t work anymore.
I appreciate your help in trying to figure this out and solve my issue. Thanks!
The complete error message and the source code of the S-Function are attached.