Interface Gui and Simulink in order to generate an executable

3 views (last 30 days)
Hello, I need your assistance about the best way to write the interface between several gui and a simulink model, but in a way that makes me generate a standalone executable. What I want is a simulation controlled by a Gui, running during infinite time unless asked by the user through the Gui. Also the user shall be able to change the inputs data of the simulink model on the fly. The Gui shall display on the fly the outputs of the simulink model. What I did is to use set_param for the intputs, and StartFcn callbacks in the simulink model for the outputs. I already found that using set_param is not possible if an executable has to be generated. It seems that the use of MAT file is not possible neither since it cannot be written on the fly (correct ?). So how do I do, what are the main concepts to use ?? is the use of simulink callbacks possible for the outputs that shall be displayed on the gui, even when an executable is generated ? Thank you very much in advance for your help. It is quite urgent since I have spent much time in that problem...

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 22 Oct 2012
Edited: Kaustubha Govind on 22 Oct 2012
I think the best way would be to use Simulink Coder to generate a shared library out of your model. Look for mdl_Uptr and mdl_Yptr on that page to see how the inputs/outputs can be accessed.
If you plan to use the Simulink code in conjunction with MATLAB Compiler, please see this previously answered question.

More Answers (1)

Sandy
Sandy on 24 Oct 2012
Thank you for your answer. Unfortunatly I don't have Embedded Coder so I cannot generate a shared library. And the link you give to a similar question does not really answer to my question because I need to share the data with Simulink on the fly. Anyway I have asked my question to the Matlab support.

Categories

Find more on Simulink Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!