Using compile-time initialization

With the MicroC profile, you can specify that elements should be initialized at compile time.

Compile-time initialization provides the following benefits:

With the compile-time initialization feature, you can specify that compile-time initialization should be used for any of the following elements:

Regarding object attributes, with the MicroC profile you can specify different compile-time initialization values for an attribute that appears in multiple instances of a class.

You specify that compile-time initialization should be used for model elements by:

Specifying compile-time initialization for relations, flow ports, and framework data

The C_CG::Configuration::AllCategoriesInitializingMode property provides the following values for setting the type of initialization to use:

Note: For flow ports and relations, compile-time initialization code is only generated for direct flow ports and direct relations (meaning that the C_CG::Configuration::DirectFlowPorts and C_CG::Configuration::DirectRelations properties must be set to True).

Specifying compile-time initialization for attributes

To have the generated code use compile-time initialization for attributes, use one of the following approaches:

Specifying initial compile-time values for attributes

With the MicroC profile, you can define different compile-time initialization values for the same attribute when it appears in multiple objects.

Use the Initial Values tab of the Features window for the package that contains the attributes.

This tab lists all the attributes for all the objects contained in the package. For each attribute, enter the relevant initialization value.

When objects contain parts, the Initial Values tab shows the parts and their attributes hierarchically.

Note: The values displayed for the attributes before you make any changes are the initial values defined at the class level.

Feedback