Import custom code

Description

Specify whether or not to parse available custom code variables and functions and compile custom code into its own simulation target. This option affects the C Caller block, the MATLAB Function block, the MATLAB System block, and Stateflow® charts.

Category: Simulation Target

Settings

Default: On

On

Enables parsing of custom code to report unresolved symbols in C charts of your model. When this option is on, Simulink®:

  • Uses the same custom code for simulation with the C Caller block, the MATLAB Function block, the MATLAB System block, and Stateflow charts. When using the C Caller block, this option must be turned on.

  • Automatically rebuilds the custom code simulation target when specified custom code dependencies change.

  • Automatically rebuilds simulation targets for blocks using custom code when custom code changes.

  • Enables Just-In-Time (JIT) compilation of the C Caller block, the MATLAB Function block, the MATLAB System block, and Stateflow charts

  • Allows the Enable custom code analysis option to enable Simulink Coverage and Simulink Design Verifier support for custom code.

Off

Disables importing of custom code. Turn off Import custom code to allow Simulink to:

  • Split custom code dependencies between Simulation Target and other means of specifying custom code dependencies (coder.cinclude, coder.updateBuildInfo, and coder.ExternalDependency) in Stateflow charts that use MATLAB® as the action language, MATLAB Function block, or the MATLAB System block.

  • Allow functions without C interfaces, and support overloaded C++ functions from custom code.

  • Permit custom code dependencies to contain declared but undefined function symbols. Otherwise Simulink creates a version of the symbol that returns a zero value.

  • In Stateflow charts that use MATLAB as the action language, you can access C++ class members with -> operator, access members in a structure containing a pointer to itself with a -> operator, and access members in a union type.

Note

You cannot split custom code dependencies by sepcifying path and the source files at different locations.

Command-Line Information

Parameter: SimParseCustomCode
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityNo impact
EfficiencyNo impact
Safety precautionOn

Related Topics