Main Content

Remove Initialization Statements for Externally Defined State Variables

Prevent initialization of externally defined variables

Since R2020b

Model Configuration Pane: PLC Code Generation / Interface

Description

The Remove initialization statements for externally defined state variables parameter removes initialization assignment statements for variables that have storage class ImportedExtern and ExportedGlobal from the generated code. Mark ExportedGlobal variables as externally defined. For more information, see Externally Defined Identifiers

Settings

off (default) | on
On

Remove from the generated code initialization assignment statements for variables that have storage class ImportedExtern and ExportedGlobal.

Off

Generated code contains initialization assignment statements for variables that have storage class ImportedExtern and ExportedGlobal.

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: PLC_PreventExternalVarInitialization
Type: string
Value: 'on' | 'off'
Default: 'off'

Version History

Introduced in R2020b