Main Content

Specify Boolean and Data Type Limit Identifiers

You can use command-line parameters to replace the default Boolean and data type limit identifiers. If you want to associate the data type limit identifiers with the data type names, consider replacing the default identifiers. You can also use command-line parameters to import a header file with the Boolean and data type limit identifier definitions.

Data Type Limit Identifiers

You can control the data type limit identifiers in the generated code by using the command-line parameters in this table.

Data Type LimitDefault IdentifierCommand-Line Parameter
64-bit integer maximumMAX_int64_TMaxIdInt64
16-bit integer maximum MAX_int16_TMaxIdInt16
32-bit integer maximum MAX_int32_TMaxIdInt32
8-bit integer maximum MAX_int8_TMaxIdInt8
64-bit unsigned integer maximumMAX_uint64_TMaxIdUint64
16-bit unsigned integer maximumMAX_uint16_TMaxIdUint16
32-bit unsigned integer maximumMAX_uint32_TMaxIdUint32
8-bit unsigned integer maximumMAX_uint8_TMaxIdUint8
64-bit integer minimum identifierMIN_int64_TMinIdInt64
16-bit integer minimumMIN_int16_TMinIdInt16
32-bit integer minimumMIN_int32_TMinIdInt32
8-bit integer minimumMIN_int8_TMinIdInt8

For example, to change the default identifiers for the 8-bit integer data limit minimum and maximum to s4g_S4MIN and s4g_S4MAX, respectively:

set_param(gcs,'MinIdInt8','s4g_S4MIN');
set_param(gcs,'MaxIdInt8','s4g_S4MAX')

If you do not import a header file, the generated file rtwtypes.h defines the 8-bit integer data minimum and maximum identifiers:

#define s4g_S4MAX                      ((int8_T)(127))
#define s4g_S4MIN                      ((int8_T)(-128))
If you do import a header file defining the data type limit identifiers, the header file is included in rtwtypes.h.

Boolean Identifiers

You can control the Boolean identifiers in the generated code by using the command-line parameters in this table. When changing boolean identifiers, you must define false to be numerically equivalent to 0, and true to be numerically equivalent to 1.

BooleanDefault IdentifierCommand-Line Parameter
True trueBooleanTrueId
False falseBooleanFalseId

For example, to change the default Boolean true and false identifiers:

set_param(gcs,'BooleanTrueId','bTrue');
set_param(gcs,'BooleanFalseId','bFalse')

If you do not import a header file, the generated file rtwtypes.h defines the Boolean identifiers:

#define bFalse                         (0U)
#define bTrue                          (1U)
If you do import a header file defining the Boolean identifiers, the header file is included in rtwtypes.h.

Note

When changing boolean identifiers, you must define false to be numerically equivalent to 0, and true to be numerically equivalent to 1.

Boolean and Data Type Limit Identifier Header Files

You can import a header file that defines Boolean and data type limit identifiers by using the configuration parameter Type limit identifier replacement header file or command-line parameter TypeLimitIdReplacementHeaderFile. The header file is included in rtwtypes.h. You must use the command-line parameters to specify the Boolean and data type limit identifiers that are included in the imported header file.

For example, if you have a header file myfile.h with data type limit definitions, use TypeLimitIdReplacementHeaderFile to include the definitions in the generated code:

set_param(gcs,'TypeLimitIdReplacementHeaderFile','myfile.h');

The generated file rtwtypes.h includes myfile.h.

/* Import type limit identifier replacement definitions. */
#include "myfile.h"

Related Topics