Main Content

ssRegisterDataTypeInteger

Register integer data type and return data type ID

Since R2020b

Syntax

extern DTypeId ssRegisterDataTypeInteger(SimStruct *S,
                                          int isSigned,
                                          int wordLength,
                                          int obeyDataTypeOverride)

Arguments

S

SimStruct representing an S-function block.

isSigned

Whether the registered data type is signed or unsigned. Specify TRUE if the data type is signed, and FALSE if the data type is unsigned.

wordLength

Total number of bits in the data type, including any sign bit, specified as an integer.

Specify 8, 16, 32 or 64 for Simulink® data types.

Specify any whole number between 1 and 65535 for fixed-point data types.

obeyDataTypeOverride

Whether the registered data type must obey the DataTypeOverride setting for the system.

Specify TRUE to indicate that the registered data type must obey the DataTypeOverride setting. Depending on the value of DataTypeOverride, the resulting data type is double, single, scaled double, or the fixed-point data type specified by the other arguments of the function.

Specify FALSE to ignore the DataTypeOverride setting.

Description

This function fully registers an integer data type with Simulink and returns a data type ID. Unlike the Simulink function ssRegisterDataType, you do not need to take any additional registration steps. You can use the data type ID to specify the data types of input and output ports, run-time parameters, and DWork states. You can also use the data type ID with all the standard data type access methods in simstruc.h, such as ssGetDataTypeSize.

Use this function to register an integer data type that is not a Simulink built-in data type. For a list of built-in integer data types see Preassigned Data Type IDs (Fixed-Point Designer).

If the registered data type has a word length other than 8, 16, 32 or 64, using this function checks out a Fixed-Point Designer™ software license. To avoid checking out a Fixed-Point Designer software license when you open or view a model, protect registration calls by using

if (ssGetSimMode(S) != SS_SIMMODE_SIZES_CALL_ONLY )
	ssRegisterDataType...

Note

Always use API functions to extract information from a data type ID about a data type in your S-function. For more information, refer to Data Type IDs (Fixed-Point Designer).

Requirement

To use this function, you must include fixedpoint.h and fixedpoint.c.

Languages

C

TLC Functions

None.

Version History

Introduced in R2020b