ssGetDataTypeStorageContainCat
Return storage container category of registered data type
Syntax
extern fxpStorageContainerCategory ssGetDataTypeStorageContainCat(SimStruct *S, DTypeId dataTypeId)
Arguments
S
SimStruct representing an S-function block.
dataTypeId
Data type ID of the registered data type for which you want to know the container category.
Description
This function returns the storage container category of the data type
designated by dataTypeId
. The container category returned by
this function is used to store input and output signals, run-time parameters,
and DWorks during Simulink® simulations.
During simulation, fixed-point signals are held in one of the types of containers shown in the following table. Therefore in many cases, signals are represented in containers with more bits than their actual word length.
Fixed-Point Storage Containers
Container Category | Signal | Container Word Length | Container Size |
---|---|---|---|
| 1 to 8 bits | 8 bits | 1 byte |
| 9 to 16 bits | 16 bits | 2 bytes |
| 17 to 32 bits | 32 bits | 4 bytes |
| 33 to word length of | Length of | Length of |
| Greater than the word length of
| Multiples of length of | Multiples of length of |
When the number of bits in the signal word length is less than the size of the container, the word length bits are always stored in the least significant bits of the container. The remaining container bits must be sign extended to fit the bits of the container:
If the data type is unsigned, then the sign-extended bits must be cleared to zero.
If the data type is signed, then the sign-extended bits must be set to one for strictly negative numbers, and cleared to zero otherwise.
The ssGetDataTypeStorageContainCat
function can also return
the following values.
Other Storage Containers
Container Category | Description |
---|---|
| Returned if the storage container category is unknown |
| Container type for a Simulink
|
| Container type for a Simulink
|
| Container type for a data type that has been
overridden with |
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
TLC Functions
Because the mapping of storage containers in simulation to storage containers in code generation is not one-to-one, the TLC functions for storage containers in TLC are different from those in simulation. Refer to Storage Container TLC Functions for more information:
FixPt_DataTypeNativeType
FixPt_DataTypeStorageDouble
FixPt_DataTypeStorageSingle
FixPt_DataTypeStorageScaledDouble
FixPt_DataTypeStorageSInt
FixPt_DataTypeStorageUInt
FixPt_DataTypeStorageSLong
FixPt_DataTypeStorageULong
FixPt_DataTypeStorageSShort
FixPt_DataTypeStorageUShort
Version History
Introduced before R2006a