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. The data type of the rounding modes is
fxpModeRounding. Possible values areFXP_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. The data type of the overflow handling methods is
fxpModeOverflow. Possible values areFXP_OVERFLOW_SATURATEandFXP_OVERFLOW_WRAP.pFxpOverflowLogsPointer to the fixed-point overflow logging structure defined by a variable of data type
fxpOverflowLogs. For more information, see Overflow Handling and Rounding Methods.
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.
Requirements
To use this function, you must include
fixedpoint.handfixedpoint.c. For more information, see Structure of the S-Function.To build an S-function that utilizes this function, you must compile it using the
mexfunction with-lfixedpointargument. For more information, see Create MEX Files.
Languages
C
TLC Functions
None
Version History
Introduced before R2006a