ssFxpConvertFromRealWorldValue
Convert value of data type double to another data
type
Syntax
extern void ssFxpConvertFromRealWorldValue
(SimStruct *S,
void *pVoidDest,
size_t sizeofDest,
DTypeId dataTypeIdDest,
double dblRealWorldValue,
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.
dblRealWorldValueDouble 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 double value to any 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
See Also
Version History
Introduced before R2006a