ssRegisterDataTypeInteger
Register integer data type and return data type ID
Syntax
extern DTypeId ssRegisterDataTypeInteger(SimStruct *S,
int isSigned,
int wordLength,
int obeyDataTypeOverride)
Arguments
SSimStruct representing an S-function block.
isSignedWhether the registered data type is signed or unsigned. Specify
TRUEif the data type is signed, andFALSEif the data type is unsigned.wordLengthTotal number of bits in the data type, including any sign bit, specified as an integer.
Specify
8,16,32or64for Simulink® data types.Specify any whole number between
1and65535for fixed-point data types.obeyDataTypeOverrideWhether the registered data type must obey the
DataTypeOverridesetting for the system.Specify
TRUEto indicate that the registered data type must obey theDataTypeOverridesetting. Depending on the value ofDataTypeOverride, the resulting data type isdouble,single,scaled double, or the fixed-point data type specified by the other arguments of the function.Specify
FALSEto ignore theDataTypeOverridesetting.
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