slbuild

Build standalone executable or model reference target for model

Syntax

  • slbuild(model)
  • slbuild(model,'StandaloneRTWTarget')
  • slbuild(model,'StandaloneRTWTarget','ForceTopModelBuild',true)
  • slbuild(model,'CleanTopModel')
  • slbuild(model,mdlreftarget)
  • slbuild(model,mdlreftarget,'UpdateThisModelReferenceTarget',buildcond)

Description

    Note:   Except where noted, this function requires a Simulink® Coder™ license.

slbuild(model) builds a standalone Simulink Coder target executable from model, using the current model configuration settings. If the model has not been loaded, slbuild loads it before initiating the build process.

slbuild(model,'StandaloneRTWTarget') builds a standalone Simulink Coder target executable from model (same as previous).

slbuild(model,'StandaloneRTWTarget','ForceTopModelBuild',true) allows you to additionally force regeneration of code for the top model of a system that includes referenced models. If ForceTopModelBuild is omitted or set to false, the build process determines whether to regenerate top model code based on model and model parameter changes.

slbuild(model,'CleanTopModel') cleans the model build area enough to trigger regeneration of the top model code at the next build.

    Note:   The following function calls for building the model reference target:

    • Honor the setting of the Rebuild parameter on the Model Referencing pane of the Configuration Parameters dialog box.

    • Require a Simulink Coder license only if you build a model reference Simulink Coder target, not if you build only a model reference simulation target.

slbuild(model,mdlreftarget) builds a model reference target, of the type specified by mdlreftarget, from model. The mdlreftarget argument must be one of the following:

  • 'ModelReferenceSimTarget' — Builds a model reference simulation target (does not require a Simulink Coder license)

  • 'ModelReferenceRTWTarget' — Builds a model reference Simulink Coder target and the corresponding model reference simulation target

  • 'ModelReferenceRTWTargetOnly' — Builds only a model reference Simulink Coder target

slbuild(model,mdlreftarget,'UpdateThisModelReferenceTarget',buildcond) allows you to specify a conditional rebuild option for the model reference target build when the Rebuild parameter on the Model Referencing pane of the Configuration Parameters dialog box is set to Never.

    Note:   The 'UpdateThisModelReferenceTarget' setting applies only to model, not to any models referenced by model.

The buildcond argument must be one of the following:

  • 'Force'

    Unconditionally rebuilds the model. This option is equivalent to the Always rebuild option on the Model Referencing pane of the Configuration Parameters dialog box.

  • 'IfOutOfDateOrStructuralChange'

    Rebuilds the model if the build process detects any changes. This option is equivalent to the If any changes detected rebuild option on the Model Referencing pane of the Configuration Parameters dialog box.

  • 'IfOutOfDate'

    Rebuilds the model if the build process detects any changes in known dependencies of this model. This option is equivalent to the If any changes in known dependencies detected rebuild option on the Model Referencing pane of the Configuration Parameters dialog box.

Input Arguments

expand all

model — Model for which to run the build processhandle | name

Model for which to build a standalone executable or model reference target, specified as a handle or a string representing the model name.

Example: gcs

mdlreftarget — Model reference target'ModelReferenceSimTarget' | 'ModelReferenceRTWTarget' | 'ModelReferenceRTWTargetOnly'

Model reference target to use for generating model code

Example: 'ModelReferenceSimTarget'

Was this topic helpful?