Data declaration
Location for data declarations
Model Configuration Pane: Code Generation / Code Placement
Description
Specify where extern
, typedef
, and #define
statements are to be declared.
Dependencies
This parameter enables Data declaration filename.
Settings
Auto
(default) | Data declared in source file
| Data defined in a single separate source file
Default: Auto
Auto
Lets the code generator determine where the declarations should be located.
Data declared in source file
Places declarations in
.c
source files where functions are located. The data header template file is not used. The code generator places the declarations in one or more function.c
files, depending on the number of function source files and the file partitioning previously selected in the Simulink® model.Data defined in a single separate source file
Places declarations in the data header file specified in the Data declaration filename field. The code generator organizes and formats the declarations based on the data header template specified by the header file (*.h) template parameter in the data section of the Code Generation pane: Templates tab.
Limitation
This parameter applies to data with storage classes except these:
ExportedGlobal
ImportedExtern
ImportedExternPointer
BitField
FileScope
Localizable
Struct
CompilerFlag
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | A valid value |
Efficiency | No impact |
Safety precaution | No impact |
Programmatic Use
Parameter: GlobalDataReference |
Type: character vector |
Value: 'Auto' | 'InSourceFile' | 'InSeparateHeaderFile' |
Default: 'Auto' |
Version History
Introduced in R2006a