MATLAB Answers

Get Simulink Coder executable to communicate with other running processes using input and output streams in R2018b

5 views (last 30 days)
I would like to get the executable I generate from Simulink Coder to communicate with a different process I have running on my machine. I have a executable program we created independently and I would like this program to send inputs to and read outputs from the executable generated from my Simulink model using Simulink Coder. I was wondering if I could use a process similar to input and output streams as in the following link:

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 22 Oct 2021
Edited: MathWorks Support Team on 26 Oct 2021
Directly generating an executable from Simulink to interface with other another custom processes is not directly supported by any Simulink feature such as blocks, Configuration Parameters, Support package, etc. Unfortunately, such functionality will have to be implemented through manual edits of generated C code and/or integrating the generated C code with you own code.
This is a common workflow for our customers and there are features in Simulink Coder that allow you to control how code is generated to make integrating the generated code with your own code easier. See the link below for controlling how Inport/Outport blocks show up in the generated code:
For more ways to control how to interface your code with external code, see the following links:
Also there is the C API that helps in accessing model information like signals and parameters, see the link below:
The Embedded Coder product would have even more features to help with this, including: model-to-code tracing, interface code report, and more interfacing options. See the link below for details.

More Answers (0)



No tags entered yet.




Community Treasure Hunt

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

Start Hunting!