Question

I have been trying to find out how to deploy a Simulink model. There are possibilities and problems as well.

  • If I use Simulink Coder how can I find the generated code on my computer? Where is it saved as a file or package of files?
  • Can we deploy Simulink as .NET Assembly? If we can, where can I find a detailed documentation about it.
  • Is there any other way to use my Simulink model standalone?

Thank you for any effort.

Was it helpful?

Solution

  1. By default all the code gets placed into a folder, in the current directory, called ModelName_CodeTarget, where ModelName is the name of your model and CodeTarget is the particular type of code you are generating. (This folder is created during the build process if it doesn't already exist.)

  2. There is no mechanism for automatically generating a .Net assembly. Simulink Coder generates C code; what you do with it is then up to you (just as it would be with hand written code). Note that the process is fully customizable, so you could create your own build process to autmatically wrap the C code into an assembly (but it would be a very advanced maneuvre to do this).

  3. There are a couple of Simulink Coder "targets" that generate standalone executable files. For instance, the GRT (Generic Real-Time) target generates a simple .exe file; the RSIM target (the Rapid Simulation Target) generates an exe where you can specify different .mat files that can be used to specify different model parameters for different simulation runs, and have the results of the different runs stored to different output .mat files.

Most of these questions are answered by looking at the early chapters of the Simulink Coder documentation. It would be worth you taking some time to look at it to get a feel for how the code generation process works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top