Main Content

Distributed Model Code Generation Options

Distributed models allow you to model complex systems as individual components and simulate the components at different sample times or cycle rates. The Simulink® PLC Coder™ distributed model code generation options allow you to generate structured text code for individual components of the model and integrate the generated code externally. Use this table to decide the code generation option to use based on your distributed model design and requirements.

GoalOption

Generate code for individual model subsystems and integrate the generated code externally.

Keep Top-Level ssmethod Name the Same as the Non-Top Level Name

Prevent initialization of externally defined variables.

Remove Initialization Statements for Externally Defined State Variables

The distributed code generation options are model-specific, and when selected at the top level, are enabled for all the model subsystems. Once you enable the option, it stays on. When generating code for individual subsystems, you might see unintended behavior in the generated code due to the option remaining on.

Related Topics