Main Content

ssFxpGetU32BitRegion

Return stored integer value for 32-bit region of real, scalar signal element

Syntax

extern uint32 ssFxpGetU32BitRegion(SimStruct *S,
                                   const void *pVoid
                                   DTypeId dataTypeId
                                   unsigned int regionIndex)

Arguments

S

SimStruct representing an S-function block.

pVoid

Pointer to the storage container of the real, scalar signal element in which the 32-bit region of interest resides.

dataTypeId

Data type ID of the registered data type corresponding to the signal.

regionIndex

Index of the 32-bit region whose stored integer value you want to retrieve, where 0 accesses the least significant 32-bit region.

Description

This function returns the stored integer value in the 32-bit region specified by regionIndex, associated with the fixed-point data type designated by dataTypeId. You can use this function with any fixed-point data type, including those with word sizes less than 32 bits. If the fixed-point word size is less than 32 bits, the remaining bits are sign extended.

This function generates an error if dataTypeId represents a floating-point data type.

To view an example model whose S-functions use the ssFxpGetU32BitRegion function, at the MATLAB® prompt, enter fxpdemo_sfun_user_U32BitRegion.

Requirement

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

Languages

C

Version History

Introduced in R2007b