Main Content


Register half-precision data type and return its data type ID

Since R2020b


extern int ssRegisterDataTypeHalfPrecision
                                         (SimStruct *S,
                                         int obeyDataTypeOverride)



SimStruct representing an S-function block.


TRUE indicates that the Data Type Override setting is to be obeyed. Depending on the value of Data Type Override, the resulting data type could be Double, Single, Scaled double, or the fixed-point data type specified by the other arguments of the function.

FALSE indicates that the Data Type Override setting is to be ignored.


This function fully registers the half-precision data type with the Simulink® software and returns a data type ID. Note that unlike the standard Simulink function ssRegisterDataType, you do not need to take any additional registration steps. The data type ID can be used to specify the data types of input and output ports, run-time parameters, and DWork states. It can also be used with all the standard data type access methods in simstruc.h, such as ssGetDataTypeSize.

Use this function if you want to register a half-precision data type. For more information on the supported half-precision format, see Half-Precision Format.

The registered data type is not one of the Simulink built-in data types, so a Fixed-Point Designer™ software license is checked out. To prevent a Fixed-Point Designer software license from being checked out when you open or view a model, protect registration calls with



Because of the nature of the assignment of data type IDs, you should 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.


To use this function, you must include fixedpoint.h and fixedpoint.c. For more information, see Structure of the S-Function.



TLC Functions


Version History

Introduced in R2020b