ssGetDataTypeFxpWordLength
Return word length of fixed-point registered data type
Syntax
extern int ssGetDataTypeFxpWordLength (SimStruct *S, DTypeId
dataTypeId)
Arguments
SSimStruct representing an S-function block.
dataTypeIdData type ID of the registered fixed-point data type for which you want to know the word length.
Description
This function returns the word length of the fixed-point data type designated
by dataTypeId. This function does not return the word length
of the container of the data type. To get the container word length, use
ssGetDataTypeFxpContainWordLen:
If the registered data type is fixed point, this function returns the total word length including any sign bits, integer bits, and fractional bits.
If the registered data type is
ScaledDouble, this function returns the word length of the nonoverridden data type.If registered data type is
singleordouble, this function errors out.
This function errors out when ssGetDataTypeIsFxpFltApiCompat returns
FALSE.
Requirement
To use this function, you must include fixedpoint.h and
fixedpoint.c. For more information, see Structure of the S-Function.
Languages
C
Examples
An sfix24_En10 data type has a word length of 24, but is
actually stored in 32 bits during simulation. For this signal,
ssGetDataTypeFxpWordLengthreturns24, which is the data type word length in bits.ssGetDataTypeFxpContainWordLenreturns32, which is the storage container word length in bits.ssGetDataTypeStorageContainerSizeorsizeof( )returns4, which is the storage container size in bytes.
TLC Functions
FixPt_DataTypeFxpWordLength
See Also
ssGetDataTypeFxpContainWordLen, ssGetDataTypeFractionLength,
ssGetDataTypeStorageContainerSize
Version History
Introduced before R2006a