Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop Embedded Coder   

Simulink Package Custom Storage Classes

The Simulink package includes a set of built-in custom storage classes. These are categorized custom storage classes, even though they are built-in, because they extend the storage classes provided by the Real-Time Workshop software. By default, you cannot change the CSCs in the Simulink package, but you can subclass the package and add CSCs to the subclass, following the steps in Resources for Defining Custom Storage Classes.

Some CSCs in the Simulink package are valid for parameter objects but not signal objects and vice versa. For example, you can assign the storage class Const to a parameter but not to a signal, because signal data is not constant. The next table defines the CSCs built into the Simulink package and shows where each of the CSCs can be used.

CSC NamePurposeSignals?Parameters?

BitField

Generate a struct declaration that embeds Boolean data in named bit fields.

Y

Y

CompilerFlagSupports preprocessor conditionals defined via compiler flag. See Generating Code Variants for Variant Models. NY

Const

Generate a constant declaration with the const type qualifier.

N

Y

ConstVolatile

Generate declaration of volatile constant with the const volatile type qualifier.

N

Y

Default

Default is a placeholder CSC that the code generator assigns to the RTWInfo.CustomStorageClass property of signal and parameter objects when they are created. You cannot edit the default CSC definition.

Y

Y

Define

Generate #define directive.

N

Y

ExportToFile

Generate header (.h) file, with user-specified name, containing global variable declarations.

Y

Y

GetSetSupports specialized function calls to read and write the memory associated with a Data Store Memory block. See GetSet Custom Storage Class for Data Store Memory.YY
ImportedDefineSupports preprocessor conditionals defined via legacy header file. See Generating Code Variants for Variant Models. NY

ImportFromFile

Generate directives to include predefined header files containing global variable declarations.

Y

Y

Struct

Generate a struct declaration encapsulating parameter or signal object data.

Y

Y

Volatile

Use volatile type qualifier in declaration.

Y

Y

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS