In general, using the code generated from Simscape™ models is similar to using code generated from regular Simulink® models. However, there are certain differences.
Coder™ software generates code from the
Simscape blocks separately from the
Simulink blocks in your model. The generated
Simscape code does not pass through
model.rtw or the Target
Language Compiler. All the code generated from a
single model resides in the same directory,
To generate and execute Simscape code, you must have a compiler and a processor that support:
64-bit precision floating-point arithmetic
32-bit integer size
For details on supported compiler versions, see
Simscape software and its add-on products provide static runtime libraries precompiled for compilers supported by Simulink Coder software. For details, see
For all other compilers, the static runtime libraries needed by code generated from Simscape models are compiled once per model during the code generation build process.
Reusable subsystems in Simulink reuse code that is generated once from the subsystem. You cannot generate reusable code from subsystems containing Simscape blocks.
A tunable parameter is a Simulink run-time parameter that you can change while the simulation is running. Simscape blocks do not support tunable parameters in either simulations or generated code.
If you choose to enable parameter inlining for code generated from a Simscape model, the software inlines all its run-time parameters. If you choose to make some of the global Simscape block parameters exceptions to inlining, the exceptions are ignored. You can change global tunable parameters only by regenerating code from the model.