Interface Gui and Simulink in order to generate an executable

1 次查看(过去 30 天)
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...

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-10-22
编辑:Kaustubha Govind 2012-10-22
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.

更多回答(1 个)

Sandy
Sandy 2012-10-24
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.

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by