Minimal code example/tutorial for interfacing Simulink models with c++ models

2 vues (au cours des 30 derniers jours)
homer
homer le 18 Juil 2019
Commenté : homer le 31 Juil 2019
Hi,
I'm searching for a fast and robust method on interfacing a Simulink model with a C++ module.
The idea is to send data from C++ modules and receive it with i.e. a Simulink input and vice versa.
As far as I know, possibly methods make use of the shared memory or UDP (IPC).
Does anyone has a minimal code example or a good tutorial on this topic for me?
Thank you and best regards
Max

Réponses (1)

Sebastien Dupertuis
Sebastien Dupertuis le 31 Juil 2019
Hi Max,
I have submitted a demo on File Exchange here that shows how to interface a C# GUI via a shared memory area in Windows and an application running in MATLAB, but also in Simulink.
The driver layer in MATLAB and Simulink that connects to the shared memory area in Windows is done via handwritten C code wrapped into MEX files for MATLAB and into S-Function and C-Caller blocks in Simulink.
Please, have a look to the Readme and Specifications files to see how the system has been implemented and works.
Thanks and best regards,
Sebastien
  1 commentaire
homer
homer le 31 Juil 2019
Thanks for the answer, I think this will help me.
Best regards,
Max

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits


Version

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by