ssFxpConvert
Convert value from one data type to another
Syntax
extern void ssFxpConvert (SimStruct *S,
void *pVoidDest,
size_t sizeofDest,
DTypeId dataTypeIdDest,
const void *pVoidSrc,
size_t sizeofSrc,
DTypeId dataTypeIdSrc,
fxpModeRounding roundMode,
fxpModeOverflow overflowMode,
fxpOverflowLogs *pFxpOverflowLogs)
Arguments
SSimStruct representing an S-function block.
pVoidDestPointer to the converted value.
sizeofDestSize in memory of the converted value.
dataTypeIdDestData type ID of the converted value.
pVoidSrcPointer to the value you want to convert.
sizeofSrcSize in memory of the value you want to convert.
dataTypeIdSrcData type ID of the value you want to convert.
roundModeRounding mode you want to use if a loss of precision is necessary during the conversion. Possible values are
FXP_ROUND_CEIL,FXP_ROUND_CONVERGENT,FXP_ROUND_FLOOR,FXP_ROUND_NEAR,FXP_ROUND_NEAR_ML,FXP_ROUND_SIMPLESTandFXP_ROUND_ZERO.overflowModeOverflow mode you want to use if overflow occurs during the conversion. Possible values are
FXP_OVERFLOW_SATURATEandFXP_OVERFLOW_WRAP.pFxpOverflowLogsPointer to the fixed-point overflow logging structure.
Description
This function converts a value of any registered built-in or fixed-point data type to any other registered built-in or fixed-point data type.
Requirement
To use this function, you must include fixedpoint.h and
fixedpoint.c. For more information, see Structure of the S-Function.
Languages
C
TLC Functions
None
Version History
Introduced before R2006a