Code Generation Applications
Code Generation Overview
Simscape™ Multibody™ supports code generation through Simulink® Coder™. You can generate C/C++ code from a Simscape Multibody model to accelerate simulation in the Simulink environment or to deploy a model onto external hardware. Model deployment requires an active Simulink Coder license while simulation acceleration does not.
Code Generation Applications
Simulation Acceleration
Simulink can generate C/C++ executable code to shorten simulation time. Two simulation modes rely on code generated from a model:
Accelerator
Rapid Accelerator
Simscape Multibody supports the two accelerator modes. You can access the simulation accelerator modes from the Debug tab. Accelerator modes do not require additional Simulink code generation products.
Note
Simulation accelerator modes do not support model visualization.
When you simulate a Simscape
Multibody model in Accelerator
or Rapid
Accelerator
modes, Mechanics Explorer does not open
with a 3-D display of your model.
Model Deployment
With Simulink Coder, you can generate standalone C/C++ code for deployment outside the Simulink environment. The code replicates the source Simscape Multibody model. You can use the stand-alone code for applications that include:
Hardware-In-the-Loop (HIL) testing
Software-In-the-Loop (SIL) testing
Rapid prototyping
Note
Simscape Multibody supports, but does not perform, code generation for model deployment. Code generation for model deployment requires the Simulink Coder product.